English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-10-02 00:40:58 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

because when you declare an array, you are declaring a list of variables that are sequential in memory. The best way to access them is with a pointer, so the first variable in the array is at the address pointed to by the name, the second by the name + 1 (assuming a character array) etc.

2006-10-02 02:37:49 · answer #1 · answered by justme 7 · 0 0

Consider the following:
char myarray[256];
This allocates a 256 byte array.

If you do something like this:
myarray=1;
Then the compiler just assumes that you mean myarray[0]

Arrays are allocated sequentially in memory, so myarray[0] is the base address and myarray[5] is 6 bytes higher in memory from the base address (myarray +5).

2006-10-02 10:01:50 · answer #2 · answered by Balk 6 · 0 0

Please be more clear about what you mean.

What language? What OS? Could you give an example of what you're on about?

Rawlyn.

2006-10-02 07:53:01 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers