so i have an array of files stored in a FILE* and need to check if they exist. if they dont, i want to print an error, but i dont know how to get the name which i want for the error message
Which name? Do you mean the format of the error message?
Last edited on
the name of the file which FILE* interfaces with
Why are you using C FILE * when you could be using C++ file streams or, better yet, Boost?
A FILE* doesn't necessarily map to a file (example: stdout) and therefore may not have a "name". So I'm pretty sure there's no way to get the filename from a FILE*.