• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 
main(int argc,char const * argv[],char const * envp[])5 int main(int argc, char const *argv[], char const *envp[]) {
6   for (int i=0; i<argc; ++i)
7     printf("arg[%i] = \"%s\"\n", i, argv[i]);
8   for (int i=0; envp[i]; ++i)
9     printf("env[%i] = \"%s\"\n", i, envp[i]);
10   char *cwd = getcwd(NULL, 0);
11   printf("cwd = \"%s\"\n", cwd); // breakpoint 1
12   free(cwd);
13   cwd = NULL;
14   return 0;  // breakpoint 2
15 }
16