Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
249 B
2
Indexable
Never
#include <iostream>
#ifdef _WIN32
    #include <direct.h>
#else
    #include "unistd.h"
#endif

int main()
{
#ifdef _WIN32
    char* res = _getcwd(NULL, 0);
#else
    char* res = getcwd(NULL, 0);
#endif
    std::cout << res << '\n';
    free(res);
}