[time-nuts] GPIB on HP5382B counter

Tom Van Baak tvb at LeapSecond.com
Sat Oct 24 20:46:26 UTC 2009


> 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




More information about the time-nuts mailing list