101263c6cSJonas Devlieghere #include <stdio.h> 201263c6cSJonas Devlieghere #include <stdlib.h> 3*b2a820faSDavid Spickett #ifdef _WIN32 4*b2a820faSDavid Spickett #include <direct.h> 5*b2a820faSDavid Spickett #else 601263c6cSJonas Devlieghere #include <unistd.h> 7*b2a820faSDavid Spickett #endif 801263c6cSJonas Devlieghere 901263c6cSJonas Devlieghere int main(int argc, char const *argv[], char const *envp[]) { 1001263c6cSJonas Devlieghere for (int i = 0; i < argc; ++i) 1101263c6cSJonas Devlieghere printf("arg[%i] = \"%s\"\n", i, argv[i]); 1201263c6cSJonas Devlieghere for (int i = 0; envp[i]; ++i) 1301263c6cSJonas Devlieghere printf("env[%i] = \"%s\"\n", i, envp[i]); 1401263c6cSJonas Devlieghere char *cwd = getcwd(NULL, 0); 1501263c6cSJonas Devlieghere printf("cwd = \"%s\"\n", cwd); // breakpoint 1 1601263c6cSJonas Devlieghere free(cwd); 1701263c6cSJonas Devlieghere cwd = NULL; 1801263c6cSJonas Devlieghere return 0; // breakpoint 2 1901263c6cSJonas Devlieghere } 20