Alright, first off I am going with some assumptions even thought I usually don't do this and I"m going to say:
- Vim is a Text Editor in Linux
- Buffer stream is nothing to do with the Vim Editor
I believe part of your confusion is the fact that Vim and the Buffer are 2 seperate parts and have nothing to do with each other directly.
Sounds like your using Vim as an editor which is cool, you could use other editors but it doesn't matter. Sounds like there are possibly 2 things you want to do, 2 parts of code you want to add and I'l explain them:
1. You want to Resorte the Input Stream.
When your buffer stream is broken it returns a boolean saying is it ok? false
Therefore you want to have code that will fix this buffer stream first before you can do anything so the boolean will read, is it ok? true
cin.clear();
This command takes the buffer stream back to a working state.
2. You want to get rid of error characters that are still in the buffer effectively cleaning it to brand new.
cin.ignore(1000,'\n');
this command means ignore up to 1000 characters of the buffer stream or until it reaches a '\n' character.
Any further problems try out this
website.Or you can hunt me down in the BC IRC channel.
DR