I thought it would be simple.. but couldn't come up with a solution.
How would I stop the following program from entering an Infinite loop when it gets an eof ?
Code:#include<iostream> #include<string> int main() { std::string str; while(true) { std::cout<<"Input: "; std::getline(std::cin,str); std::cout<<str<<std::endl; } return 0; }



LinkBack URL
About LinkBacks


