Also, if you're using std::strings for a filename you'll have to convert them to const char* for ifstream. The c_str() function will do that for you:
std::string filename = "my_file.txt";
std::ifstream infile(filename.c_str());
Moderator
Featured Poster
Reputation Points: 4142
Solved Threads: 394
Industrious Poster
Offline 4,132 posts
since Oct 2006