pwd
使用getcwd()
函数打印当前工作目录的绝对路径。
那么,在c中有返回当前工作目录相对路径的函数吗?
最佳答案
So, is there a function that returns relative path of the current working directory in c?
相对路径 通常是相对于当前工作目录的。所以你的问题真的没有意义。
唯一有效的答案是:
const char *get_rel_cwd(void)
{
return ".";
}
关于c - 如何在c中获取相对路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40325082/