Code:
#include <iostream>
using namespace std;
int main()
{
for ( ; ; )
{
char inputforcase = 0;
cin>> inputforcase;
cin.ignore(inputforcase, '\n');
switch ( inputforcase )
{
case '1' :
{
cout<<"bla \n";
cin.get();
}
break;
}
}
}
then why first code acts diferit then this code below if u input 111
Code:
#include <iostream>
using namespace std;
int main()
{
for ( ; ; )
{
char inputforcase = 0;
cin>> inputforcase;
cin.ignore(0, '\n');
switch ( inputforcase )
{
case '1' :
{
cout<<"bla \n";
cin.get();
}
break;
}
}
}