I need access to the program environment (not with getenv() etc., but the adress)
The following crashes:
---------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char *argv[], const char *envp[]) {
size_t i;
if (envp != NULL) {
for (i = 0; envp != NULL; i++) {
puts(envp);
}
}
return 0;
}
-----------------------------------------------------------
Is there a variable like 'environ' pointing to the global environment?
czerny
Under POSIX I think the following is defined:
extern char **environ;
Under Pelles C there is nothing with this name. Is there something equivalent?
czerny
Look at this:
http://www.codersource.net/win32_getenvironmentvariable.html
Alex ;-)