Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
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
bgColor#ccccff
_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;
}

...