Go Back   Velocity Reviews > Newsgroups > C++
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

C++ - extern ** environ...

 
Thread Tools Search this Thread
Old 01-13-2008, 08:16 AM   #1
Default extern ** environ...


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


Rahul
  Reply With Quote
Old 01-13-2008, 10:58 AM   #2
James Kanze
 
Posts: n/a
Default Re: extern ** environ...
On Jan 13, 9:16 am, Rahul <sam_...@yahoo.co.in> wrote:

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

--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34


James Kanze
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46