ifstream question

Ok I am writing a translator program for a class I am taking. If i am using an ifstream called inputFile I know I can use inputFile.get(char) to read a single character from the file but how would I get an entire word up to the next whitespace? Hopefully you understand what I mean.
Like this:

1
2
string word;
inputFile >> word;
Wow that is much simpler than I thought it would be lol. Now say if I have a commands file in the following format

InputFileName CommandChar OutputFileName
InputFileName CommandChar OutputFileName
InputFileName CommandChar OutputFileName
.
.
.

I need to batch process through them. When you use the above method to put the word into a string will it consume to following white space or leave it there? because essentially I need to read the the first word into a string, then read the character in and then read the output name into another string so I can perform the operations upon it.
It reads until whitespace, and does not include the whitespace in any strings it inputs to.
http://www.cplusplus.com/reference/iostream/istream/operator%3E%3E/
Topic archived. No new replies allowed.