#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char a_char;
int cu = 1;
while (cu != -1)
{
cin>>a_char;
cout<<"Is a digit!" << a_char << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
When I input a132, the output is:
Is a digit!a
Is a digit!1
Is a digit!2
Is a digit!3
my expect result is Is a digit!a123, why my code doesn't work? plx help