Return a variable as 0 if a file does not exist, 1 if it does exist.
Thanks
This is a discussion on How would I do this...? (file I/O) within the C++ Programming forums, part of the General Programming Boards category; Return a variable as 0 if a file does not exist, 1 if it does exist. Thanks...
Return a variable as 0 if a file does not exist, 1 if it does exist.
Thanks
Create a function that tries to open the file with a ifstream object (make sure you use the standard headers). Test whether the file is open with ifstream::is_open(). Return one if is_open() returns non-zero or zero if it returns zero.
zen
Yes, and how exactly would I do that?
I know what functions are etc./ but how would I use the function you talked about?
thanks for helping![]()