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