Input of Unkown Size
I am solving problem, where I need to perform the same operation of an unknown number of test cases.
My problem is I do not know how to know when to stop reading input.
So what's the problem?
void foo( std::istream& stm )
int a, b ;
while( stm >> a >> b )
// process iniput a, b
std::cout << a*b << '\n' ;
Thank You. Line 4 really helped.
Topic archived. No new replies allowed.