What is the problem? Just use ifstream's >> operator and it will skip all white space (spaces, tags, etc) between words.
>> How would i tell when the file ends
when the loop below exits
std::string word;
ifstream in("file.txt");
while( in >> word)
cout << word << "\n";
Last edited by Ancient Dragon; Sep 6th, 2009 at 12:03 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,947 posts
since Aug 2005