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