Versions Compared

Key

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

...

Code Block
main(int argc, char **argv, char **envp) {}

Wiki Markup
According to C99 \[[ISO/IEC 9899-1999:TC2|AA. C References#ISO/IEC 9899-1999TC2]\]:

...

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

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

   return 0;
}

...

Code Block
bgColor#ccccff
extern char **environ;

int main(int argc, char **argv) {
   setenv("MY_NEW_VAR", "/usr/binnew_value", 1);

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

   return 0;
}

...