delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/09/09:34:09

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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019