cin.ignore and cin.get statment

Input data is:
10 20 30 40 50 60
10 20 30 40 50 60
10 20 30 40 50 60
70 80

The input statement is:
cin >> a >> b >> c;
cin.ignore(100, '\n');
cin.get(ch1);
cin >> d >> e >> f;
cin.ignore(100, '\n');
cin.ignore(100, '\n');
cin >> a >> b;

What are the contents of variables a, b, c, d, e and f after the statements are executed?

I tried to read up on the ignore function and get functions and it sounds like it just speeds through the formula. I I have no idea how to figure out the contents of those variables. If someone could tell me what "a" is and how you got it then I could figure out the rest on my own. I just need some guidance. Thanks!!
Why no compile it? It's what you do with code...
a 70; b 80; c 30; d 0; e 20; f 30; ch1 '1';
Unless I'm misunderstanding what you're asking, just display them using cout.

Example:
1
2
3
char a;
cin >> a;
cout << a;


that will take a single character, and then output it. A more clear example:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>

using namespace std;

int main()
{
    int x;
    cout << "x = ";
    cin >> x;
    cout << "x is " << x;

    return 0;
}

This one is a bit cleaner. Instead of a letter, it takes a number. Compile that and play around with it.
Thanks I figured it out!!
Topic archived. No new replies allowed.