cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : Beginners : cin>>a(where a has been declared int)(wh...
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Articles
Lounge
Jobs

-

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

kamalsharma007 (3)
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???
|
guestgulkan (252)
You can always try it and find out.
|
firedraco (336)
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.
|

This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2008 - All rights reserved - v2.2
Spotted an error? contact us