cin>>a(where a has been declared int)(what if user enters char)

Hi, what is the output of foll. prog and why?
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
cin>>a>>b;
cout<<"\n"<<a<<"\n"<<b;
getch();
}

if 'A'(character 'A' instead of any Integer value) is given as its first input what will happen and why???
You can always try it and find out.
Um, IIRC, it will glitch and start spamming you with messages and stuff...so don't do it. And no, I don't know why.
Topic archived. No new replies allowed.