Mail Archives: djgpp/2000/04/29/09:08:55
J-P wrote:
> If char arrayname[80] is an array of 80 char,
> . arrayname is (equivalent to) a pointer to the first char
> . &arrayname is a pointer to a pointer to the first char
No. Try compiling HPMAN's example with the & and then without, and you
will get an identical .exe.
Here, arrayname is an array, and will be implicitly converted to a
pointer to (its first) char in most contexts.
Meanwhile, &arrayname is a pointer to an array. The array has the same
address as its first char, so this differs from a pointer to the first
char only in its type, not in its value.
>This is fundamental C programming. Have a look at Kernighan & Ritchie, or
>possibly the C FAQ.
You could have a look yourself, although I don't think K&R 2nd ed.
explains this very clearly, unless I have looked in the wrong places.
None of this is relevant to HPMAN's problem, but until he posts some
non-working code there's no way to tell what his problem is.
S.
- Raw text -