TetaTricks/code/C/use_envp.c

17 lines
277 B
C
Raw Permalink Normal View History

2024-08-09 01:05:30 +11:00
/* using envp for fun and profit */
#include <stdio.h>
int main(int argc, char *argv[], char *envp[])
{
char *cptr;
int idx = 0;
cptr = envp[idx];
while ( NULL != (cptr=envp[idx]) ) {
fprintf(stderr, "envp[%d] %p --> %s\n",
idx, cptr, cptr);
idx++;
}
return 0;
}