I used "cin" to read words from input stream, which like
int main( ){
     string word;
     while (cin >> word){
         //do sth on the input word
     }
    // perform some other operations
}
The code structure is something like the above one. It is compilable. During the execution, I keep inputting something like
aa bb cc dd
My question is how to end this input? In other words, suppose the textfile is just "aa bb cc dd". But I do not know how to let the program know that the file ends.
 
     
     
     
     
     
     
     
     
     
     
     
     
    