[prog] Another C++ problem

Robert J. Hansen rjh at sixdemonbag.org
Tue Apr 22 17:46:53 EST 2003

>         fstream inFile;       // I spent ages trying to get ifstream to work 

Remove this line and things should work much better.  You're creating an
object which shadows an identical object declared as a class member.  So
sure, you're opening up _this_ inFile, but the _member_ inFile never
gets opened.

It should also be an ifstream--the code I sent you off-list has examples
of how to use ifstreams.

Robert J. Hansen <rjh at sixdemonbag.org>

More information about the Programming mailing list