In this code, when user inputs c:\temp
, getcwd()
returns "c:temp"
.
Actual path is C:Temp
.
if(chdir(fullpath))
{
perror("cd");
return 1;
}
if(!getcwd(path, sizeof(char*) * 260))
{
perror("getcwd error");
getchar();
exit(1);
}
I expected it to return "C:\Temp"
. Is there any way to get case-sensitive current working directory in C? Wherever I searched, there was only getcwd()
.