...
Code Block | ||
---|---|---|
| ||
int main(int argc, char const *argv[], char const *envp[]) {
size_t i;
if (_putenv_s("MY_NEW_VAR", "new_value", 1) != 0) {
/* Handle Error */
}
if (envp != NULL) {
for (i = 0; envp[i] != NULL; i++) {
puts(envp[i]);
}
}
return 0;
}
|
...
Code Block | ||
---|---|---|
| ||
_CRTIMP extern char **_environ;
/* ... */
int main(int argc, char const *argv[]) {
size_t i;
if (_putenv_s("MY_NEW_VAR", "new_value", 1) != 0) {
/* Handle Error */
}
if (_environ != NULL) {
for (i = 0; _environ[i] != NULL; i++) {
puts(_environ[i]);
}
}
return 0;
}
|
...