Skip to content

Instantly share code, notes, and snippets.

@khajavi
Created September 7, 2013 12:52
Show Gist options
  • Save khajavi/6475333 to your computer and use it in GitHub Desktop.
Save khajavi/6475333 to your computer and use it in GitHub Desktop.
get environment var in c
#include <stdlib.h>
#include <stdio.h>
int main( int argc, char **argv, char **envp ) {
char **env;
for( env = envp; *env; env++ )
printf( "%s\n", *env );
exit( 0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment