From: dzierzaw AT elektryk DOT ie DOT pwr DOT wroc DOT pl (Springman) Newsgroups: comp.os.msdos.djgpp Subject: Re: char **argv vs. char *argv[] Date: 9 Jun 1997 11:28:31 GMT Organization: - Message-ID: <5ngpcv$a6v$3@sun1000.pwr.wroc.pl> References: <5ndap9$mgd AT freenet-news DOT carleton DOT ca> <01bc74bd$7df85940$e38033cf AT pentium> NNTP-Posting-Host: shl.ie.pwr.wroc.pl Lines: 21 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <01bc74bd$7df85940$e38033cf AT pentium>, "Gil Myers" says: > >Paul Derbyshire 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.