char **environ
is NULL
-terminated array of strings, so you should try:
extern char **environ;
char **p;
for (p = environ; *p; p++) {
printf ("%s\n", *p);
}
In other words, environ[0]
is pointer to first env variable, environ[1]
to second etc. Last element in environ
array is NULL
.
el.pescado
2010-06-27 14:27:37