为什么以下代码会产生以下输出?
更新我的代码:我得到了基本相同的东西。
#ifdef _WIN32
#include <windows.h>
#include <direct.h>
#define GetCurrentDir _getcwd
#else
#include <unistd.h>
#define GetCurrentDir getcwd
#endif
//==============================MAIN=======================================
#ifdef _WIN32
int main(int argc, char **argv)
{
char *path = (char*)malloc(sizeof(char)*FILENAME_MAX);
GetCurrentDir(path, sizeof(path));
printf("path: %s\n", path);
//other stuff
}
//==============================END========================================
输出 路径: -