At 9:38 AM +0100 2002/03/14, Thomas Maeder wrote: >Alan Ingleby wrote: >> >> unsigned char a[40]; // Keep in mind that this creates a buffer of 40 >> bytes, and sets a to be a POINTER to that buffer. > >This is not exact. > >a is an array, not a pointer. It is implicitly converted to a pointer to >the element at index 0 whenever needed, though.
We may be saying the same thing here, but in C, arrays and pointers are the same thing. There is no implicit conversion... ever. Arrays do not posses any knowledge of their length. Pointer objects have two properties: an address in memory, and the width (in bytes) of the data at that address. This allows statements such as "p++" which increments the pointer "p" to the next element in the array, because the size of each element of the array is explicitly known at compile time. Regards, Jim Schram PalmSource Inc. Partner Engineering -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
