> > I know that getenv and putenv are working on UNIX and Windows. But
> what about getting all of them? [..]
> > [how do I get all environment variables, not just one]
> > But…what about Windows? I am talking about native Windows, not cygwin
> or mingw.
>
> You probably want GetEnvironmentStrings.
>
> Google should be your friend here; found in seconds searching for
> "C++ windows get all environment variables" which brought me to
> this stackoverflow article:
>
http://stackoverflow.com/questions/9535112/get-all-env-variables-
> in-c-c-on-windows
>
> Ya, the 3 argument version of main() is probably not something we
> support
> on Windows native, because of how FLTK provides its own WinMain()
> and calls
> only the two argument version of main().
>
> However, I guess I'd be surprised if native windows didn't support
> the global "extern char **environ" thing.. try it; if it works,
> that'd
> be a cross platform solution.
I have a vague recollection that I tried this and it worked, some time ago, but am not sure...
Though to be honest I rarely grab the full environ anyway, I'm usually only interested in the vars I know the names of.
Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************