c++ question

Richard Scott McNew richard.scott.mcnew at gmail.com
Fri Sep 22 16:35:36 MDT 2006

> It depends on what you mean by "character array".  If you are talking
> about a variable declared like so:
> char myarray[32];
> Then to get the address, you would do the following:
> print("The address is %p\n", (&myarray));

Shouldn't that be:
print("The address is %p\n", (myarray));

The variable myarray is a pointer to the beginning of the array.  That
means that:
*myarray and myarray[0] are the same.

More information about the PLUG mailing list