If I want to read to a buffer a specified number of characters I'll use:
Code:
char text[12];
...
cin >> setw(sizeof(text) / sizeof(char)) >> text;
But if the user writes more than 11 characters I'm in trouble when I want to read next time:
Code:
int i = 0;
...
cin >> i;
I'm gessing that the characters the user put in that the first cin ignored still is in the istream-buffer, but I don't know how to clear the istream-buffer.

I tryed to use also:
Code:
cin.getline(text, 12);
but it works only worse.

Any suggestions?
Suzi