Versions Compared

Key

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

...

Code Block
bgColor#ffcccc
int main(int argc, char **argv, char **envp) {
   setenv("MY_NEW_VAR", "new_value", 1);

   if (envp != NULL) {
      for (i = 0; envp[i] != NULL; i++) {
         printf("%s\n", envp[i]); 
      }
   }

   return 0;
}

envp no longer points to the current environment, so MY_NEW_VAR will not be found in envp.

...