I was tried to debug to find an explanation to this but i still don't really understand the concept. Here goes.
//pass in value
//973 456.2 77F
//973 456.2 77F
#include<iostream>
using namespace std;
int main()
{
char letter;
int n;
float m;
cin>> m;
cin.clear ();
cin.ignore (200, '\n');
cin>> letter>> n>> n;
cout<< letter<< m<< n<< endl; //pass out 9973456
}
I am stuck in how does cin.clear() and cin.ignore(200, '\n') work and does it really ignore 200 characters? If possible, a total explanation of how the whole snippet works will be desirable. Thanks again for spending time to look at my code. I welcome any suggestion and criticism. :)