Not quite.  You need &buf[0]

 buf is a pointer to the array. (first element)
 &buf is a pointer to that pointer.
 &buf[0] is a pointer to the first element of the array.

Hal, try the following with your C compiler...

#include <stdio.h>
void main ()
{
   char buf[100] = { 3,1,4,1,5 };

   printf("0x%.8lX\n", buf);
   printf("0x%.8lX\n", &buf);
   printf("0x%.8lX\n", buf[0]);
   printf("0x%.8lX\n", &buf[0]);
}

And see if your results and intuition agree.

0x0012FF1C
0x0012FF1C
0x00000003
0x0012FF1C

/tvb


_______________________________________________
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to