Mail Archives: djgpp/1997/06/09/09:34:09
In article <01bc74bd$7df85940$e38033cf AT pentium>, "Gil Myers" <gmeyers AT logan DOT net> says:
>
>Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA> wrote in article
><5ndap9$mgd AT freenet-news DOT carleton DOT ca>...
>>
>> I've seen char **argv and char *argv[] and am curious which is correct.
>Or
>> are either correct?
>>
>I don't think either is more correct than the other, although *argv[] is
>most
>certainly used more.
The *argv[] is used more probably because it is safer. Why?
A basic example:
void func1 (int *p);
void func2 (int p[]);
Both func1 and func2 accept pointers to ints as arguments. But they are
not exactly the same. The func2 takes a pointer that is constant, i.e.
you'll get warnings when you try to modify its value.
- Raw text -