I have the following code:
int choice = 0;
char st1[N];
cout << "enter choice" <<endl;
cin >> choice;
cout << "enter sentence" << endl;
cin.get(st1, N-1);
when getting to cin.get line, no matter what the input is, it will read \0 char into st1[0] and that's it.
I assume it has something to do with the latest cin ( into choice variable ).
How do i "clean" cin buffer before getting new input from the user? if that's possible.
thanks