i have a user input,say it is 100100
..i want at the end of this input..my main function returns 0. AKA break the loop and program terminates normally.
but my function stuck and keep waiting for more input from user..even though the input is finished.
so what's wrong with this code ?
int main(){
char ch;
while (cin>>ch ) {
cout << ch;
}
return 0;}
the output should be "100100" then program terminates normally (return 0) but it keeps waiting..
Aucun commentaire:
Enregistrer un commentaire