I have MISTAKENLY found the scenario while executing the following block of code
#include <iostream>
using namespace std;
int main()
{
int input1;
float input2;
cout << "Enter a real number :";
cin >> input1;
cout << "The int number is " << input1 << endl;
cout << "Enter another number :";
cin >> input2;
cout << "The float number is " << input2 << endl;
}
The output for the above is
Enter a real number :a
The int number is -858993460
Enter another number :a
The float number is -1.07374e+08
Can anyone kindly explain how internally the above scenario is getting handled resulting in the above scenario ?
Note -
- Running the above in VS2015.
As i am newly experimenting with C++, please point me to any reference if i have missed in the process.