cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
how to check if a FILE is open
how to check if a FILE is open
Oct 9, 2010 at 1:07pm UTC
cmdcenter
(10)
I've got a FILE pointer like this:
FILE* file;
How can I check if it's open? Is it possible to use ofstream::is_open method?
Oct 9, 2010 at 1:29pm UTC
Bazzy
(6281)
if you call fopen, you can check for NULL
FILE* is for C file I/O
ofstream is for C++ file I/O
You can mix them but it may get a bit complicated:
http://www.cplusplus.com/forum/articles/22316/
Topic archived. No new replies allowed.