Reputation: 113
pwd
prints the absolute path of the current working directory by using getcwd()
function.
So, is there a function that returns relative path of the current working directory in c?
Upvotes: 0
Views: 2594
Reputation: 137398
So, is there a function that returns relative path of the current working directory in c?
Relative paths are usually relative to the current working directory. So your question doesn't really make sense.
The only answer valid would be:
const char *get_rel_cwd(void)
{
return ".";
}
Upvotes: 3