Hello,
Is there a simple way in C to take input from the user either via fgets or char array coming into main and then discern whether it is a file or a directory that is being referenced?
i.e. if I ask the user:
"Please enter a filename"
and they supply text, how can I within C check to see if they supplied me the name of a file or a directory?
Thanks!
Start Free Trial