Re: is this stadard C?
From: Keith Thompson (kst-u_at_mib.org)
Date: 02/22/05
- Next message: Keith Thompson: "Re: Is this board a good alternative to the PC?"
- Previous message: Al Bowers: "Re: error when allocating memory using a pointer inside a struct via a function"
- In reply to: E. Robert Tisdale: "Re: is this stadard C?"
- Next in thread: Villy Kruse: "Re: is this stadard C?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 22 Feb 2005 21:47:28 GMT
"E. Robert Tisdale" <E.Robert.Tisdale@jpl.nasa.gov> writes:
> Keith Thompson wrote:
>
>> Passing the extra parameter to main() is one way to do it.
>> Another is (I think) declaring "extern char *environ[];".
>> The latter is cleaner, IMHO.
>> Both, of course, are non-standard.
>
> getenv(const char *) *is* standard
> but you must know the environment variable name
> that you are looking for.
Yes, thank you for restating the obvious. In Alan Balmer's previous
article, to which I was responding, he wrote (and I quoted):
] If you know the name of the environment variable you're looking for,
] yes, it's easier to use getenv(). If, for some reason, you wanted to
] search the environment variables, the "char *env[]" form would be
] the way to do it.
You also snipped the "<OT>" and "</OT>" tags I had placed around my
comments.
-- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst> We must do something. This is something. Therefore, we must do this.
- Next message: Keith Thompson: "Re: Is this board a good alternative to the PC?"
- Previous message: Al Bowers: "Re: error when allocating memory using a pointer inside a struct via a function"
- In reply to: E. Robert Tisdale: "Re: is this stadard C?"
- Next in thread: Villy Kruse: "Re: is this stadard C?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|