[Solved] C – list all files in current directory then move in directory above, list files, and so on until root directory is reached [closed]
Your cwd[1] != 0 or cwd[1] != ‘\0′ is an okay way to do it. There’s no need to cast that to an int. You could also use strcmp(cwd, “https://stackoverflow.com/”), which makes it slightly more clear what you are doing. This will be zero at the root directory on a UNIX or Linux system. For … Read more