How to access the environment variables in VC++ 6.0 console application ? Can anybody of you please give me an example
for the same ?

--Bansidhar

Re: accessing the environment variables. by Les

Les
Thu Apr 22 08:37:52 CDT 2004


"Bansidhar" <anonymous@discussions.microsoft.com> wrote in message
news:8741C535-1900-4C34-A2B6-FACAD91A2169@microsoft.com...
> How to access the environment variables in VC++ 6.0 console application ?
Can anybody of you please give me an example
> for the same ?


If you have the MSDN documentation see the "getenv" / "_wgetenv" function.
It returns a char*

/* Get the value of the LIB environment variable. */
char *libvar;
libvar = getenv( "LIB" );

hth
Les

>
> --Bansidhar



Re: accessing the environment variables. by Mark

Mark
Thu Apr 22 08:43:28 CDT 2004

> How to access the environment variables in VC++ 6.0 console application ?
Can anybody of you please give me an example
> for the same ?
>
Look up "getenv" in MSDN, sample code is included in the help.