From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: environment variables Date: Sun, 15 Jun 1997 13:47:02 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 35 Message-ID: <33A3F256.6D7C@cs.com> References: <01IJYIJ9NKOI8ZPIWK AT NICKEL DOT LAURENTIAN DOT CA> <339F3A64 DOT 5551 AT cs DOT com> <33A31DC6 DOT E42 AT cam DOT org> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp110.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Vic wrote: > > John M. Aldrich wrote: > > > main(int argc, char *argv[], /*something here*/) > > > > There may well be (in fact, I think there is), but it's a nonstandard > > way to get the environment. The standard interface is through the > > getenv() and putenv() functions; look them up in the libc docs for more > > info. > it's main(int argc, char *argv[], char *env[]) > I think every compiler supports this one From the comp.lang.c Frequently Asked Questions, question 11.13 (http://www.eskimo.com/~scs/C-faq/q11.13.html): Question 11.13 But what about main's third argument, envp? It's a non-standard (though common) extension. If you really need to access the environment in ways beyind what the standard getenv function provides, though, the global variable environ is probably a better avenue (though it's equally non-standard). References: ANSI Sec. F.5.1 ISO Sec. G.5.1 H&S Sec. 20.1 pp. 416-7 -- --------------------------------------------------------------------- | John M. Aldrich | "A woman is not property, and hus- | | aka Fighteer I | bands who think otherwise are living | | mailto:fighteer AT cs DOT com | in a dreamworld." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------