Skip to content

Commit 798a994

Browse files
authored
Create envaddr.c
1 parent c33e199 commit 798a994

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

envaddr.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* envaddr.c */
2+
#include <stdio.h>
3+
#include <stdlib.h>
4+
5+
int main()
6+
{
7+
char *shell = (char *)getenv("MYSHELL");
8+
9+
if(shell){
10+
printf(" Value: %s\n", shell);
11+
printf(" Address: %x\n", (unsigned int)shell);
12+
}
13+
14+
return 1;
15+
}

0 commit comments

Comments
 (0)