delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/15/17:17:19

From: "John M. Aldrich" <fighteer AT cs DOT com>
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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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        |
---------------------------------------------------------------------

- Raw text -


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