extern ** environ...

R

Rahul

Hi Everyone,

I once had a look at a code having the following declaration,

extern ** environ or extern char ** environ...

I lost the code and i'm wondering what is the exact need of this? Does
anyone have any idea on this?

Thanks in advance!!!
 
J

James Kanze

I once had a look at a code having the following declaration,
extern ** environ or extern char ** environ...
I lost the code and i'm wondering what is the exact need of
this? Does anyone have any idea on this?

It should be "extern char** environ". And it is a Unixism;
according to Posix, it should be declared in <unistd.h>. See
http://www.unix.org/single_unix_specification/ for more
information (search for environ). And of course, don't use it
in portable code, although I wouldn't be too surprised if
Windows supported it as well. (In practice, it is exceedingly
rare to need to access it directly in Unix as well. I may have
done so once, in twenty years of Unix programming, and that was
implementing the getenv() function.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top