delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/12/09:49:05

To: djgpp AT delorie DOT com
Date: Thu, 12 Jun 1997 06:46:02 -0700
Subject: Re: environment variables
Message-ID: <19970612.064604.9222.0.bshadwick@juno.com>
From: bshadwick AT juno DOT com (Ben N Shadwick)

>How do you determine in C or C++ what the environment variables
>are set to.  I think there is another varible in
>
>main(int argc, char *argv[], /*something here*/)
>
>Timothy Robb

I'm not sure about that, but I do know that there is a stdlib.h function
(it's an ANSI function, btw) called getenv to which you pass a string
containing the evironment variable you're interested in, and it returns a
pointer to the string containing it's value (or NULL if it doesn't
exist).

It seems like there should be some kind of function to allow you to just
browse through them all without knowing the name of each variable, in
case you just want to look over what variables there are, but I don't
recall any.

=====
Ben Shadwick, Sysop, Mars Base BBS, (360)882-0773, Vancouver, WA, USA
Unofficial member, TheGods/DemiUrg Software,
http://www.swiftsite.com/thegods
email: bshadwick AT juno DOT com (please reply to newsgroup posts via email too)

- Raw text -


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