Re: is this stadard C?

From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 02/22/05


Date: Tue, 22 Feb 2005 12:46:25 -0800

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.



Relevant Pages

  • Re: progrm to find a substring in a string
    ... Use either int mainor int main(int argc, ... char **argv). ... CBFalconer as a non-standard but more robust variant. ... This function can be replaced by the standard strstr() function. ...
    (comp.lang.c)
  • Re: Destructor: not gauranteed to be called?
    ... >>> the ToStringmethod to a Char[] it returns with the EXACT SAME ... >>> the standard and might break someone's existing code. ... ToString is not part of the C++ ... The fact yhat you require or expect a Charto act as a string is a sign ...
    (microsoft.public.dotnet.languages.vc)
  • Re: byte order
    ... int am_i_little_endian{ ... Are you *absolutely* sure that's standard C, ... assuming a 8-bit char). ... The pointer casting rules specify that "It is guaranteed that ...
    (comp.lang.lisp)
  • Re: An Observation
    ... You execute it now or you execute it later. ... I explained CHAR and as I did in my prior post in ... complexity around and was not actually any simpler. ... because of the sloppiness of the standard. ...
    (comp.lang.forth)
  • Re: I want unsigned char * string literals
    ... within the text one should cast to unsigned char first. ... The original Standard tried to codify ... useless at this point. ... locale - no context object so it can't be safely used in libraries ...
    (comp.lang.c)