whats the use of third argument to main( ), i.e. environmental
parameters.... if i am not wrong ? 1st 1 is argc 2nd is argv and what
bout the 3rd 1???????????
The C standard specifies that main can take no arguments:
int main(void)
or two arguments:
int main(int argc, char **argv)
Implementations are allowed to accept other forms, but such forms are
non-standard and should probably be discussed in a newsgroup specific
to the system you're using.
One common extension is to accept a third argument that points to the
environment:
int main(int argc, char **argv, char **envp)
The standard getenv() function provides some, but not all, of the
functionality of this third argument. Some systems also make it
available as an external variable called "environ". It's a pointer to
an array of pointers to strings, each of the string represents an
environment variable.
Code intended to be maximally portable should only access the
environment through the getenv() function.