[Info-vax] Dave Cutler, Prism, DEC, Microsoft, etc.
Michael Kraemer
M.Kraemer at gsi.de
Thu Dec 17 02:42:13 EST 2009
toby schrieb:
> On Dec 16, 9:40 pm, JF Mezei <jfmezei.spam... at vaxination.ca> wrote:
>
>>toby wrote:
>>
>>>In a standard C compiler where mystring is an array,
>>>mystring , &mystring , or &mystring[0] are all the same pointer.
>>
>>In ANSI C, &mystring is not accepted.
>
>
> My gcc 4.1.2 with -ansi -pedantic accepts it. It always gives a
> warning, "assignment from incompatible pointer type".
>
> e.g.
> char a[], *p;
> p = &a;
>
which seems correct, IMHO.
p is of type "char *",
&a is of type "char **".
So mystring and &mystring are not the same,
mystring and &mystring[0] are.
More information about the Info-vax
mailing list