Versions Compared

Key

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

...

Portable code should use environment variables that differ by more than capitalization.

Code Block
bgColor#ffcccc#ccccff
char *temp;

if (putenv("TEST_ENV_1=foo") != 0) {
  /* Handle Error */
}
if (putenv("TEST_ENV_2=bar") != 0) {
  /* Handle Error */
}

temp = getenv("TEST_ENV");

if (temp == NULL) {
  /* Handle Error */
}

printf("%s\n",temp);

...