Last active
July 8, 2016 18:55
-
-
Save irondoge/13284d634ebfd5eb0e21a9c66db7eb87 to your computer and use it in GitHub Desktop.
get a pointer to the environment variables from any function [compilation: gcc -W -Wall -Wextra -std=c89 environ.c]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(int ac, char **av, char **env) | |
| { | |
| extern char **environ; | |
| (void)ac; | |
| (void)av; | |
| printf("%p = %p | => %s\n", environ, env, environ[0]); | |
| return (0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment