-
cin >> buf endless loop
Hi
I have the code
Code:
#include<iostream>
using namespace std;
int main()
{
string buf;
while( cin >> buf )
{
cout << buf;
//do some process in buf
}
//end the loop someway
cout << "The result";
return 0;
}
With what keyboard shortcut I can end the loop in order to proceed in my program ( I am not interested in signal solution or
Code:
if ( buf == "END" )
break;
Thanks
-
guess you mean control-D ( unix ) or control-Z ( Windows )
Kurt
-
then you are interested in doing a windows application, not a console application. If you don't want to do signal processing or checking user input, then you need to do a windows application and use a message loop to check for keyboard shortcuts.