Mail Archives: djgpp/1998/03/03/17:16:21
Noam Rotem wrote:
> I try and try and try, and can't understand how come the address of an array is the same
> as the address of the first cell of it.
>
> int Arr[SIZE];
> if (Arr==&Arr) printf("Well, I give up...");
>
> I always thought the name of an array to act as a pointer to the first value. Am I wrong
> somehow?
>
> Does this mean I can use scanf("%s",&Str)?
(signature clipped)
If my thinking is correct, then the following snippet should explain your problem:
int array[SIZE];
*array = 1; //*array points to the first data element in the array
array = 1; //this is not allowed, because you are trying to change the address of the first
element of the array.
//end code
--
Isaac Waldron <waldroni AT lr DOT net>
http://www.geocities.com/SiliconValley/Lakes/3574/index.html
- Raw text -