Not sure if I should be using seekg()
Just a simple question. I created a function to validate numeric data coming in from cin. I read the posts and some say to use ignore(5000,'\n') or some other huge number. I found that seekg(o,ios::end); seems to work as well but I am not sure if it is going to cause any problems? I would think that it seeks to the end of the stream and effectively ignores all data in the stream. I am just not sure if this is the proper way to use seekg(). Anyway here is my simple function.
int validate_input(const char*message)
while( (ch= cin.get() )!='\n')
if((ch>='0' ) && (ch<='9'))
cout<<"invalid input Please reenter: \n";