S
subramanian100in
I found the following code fragment in the C++ Primer(Fourth Edition)
by Stanley Lippman in page 213.
string inBuf;
while (cin >> inBuf && ! inBuf.empty( ) )
{
// do something
}
Here is the condition check ( ! inBuf.empty() ) needed ?
is it possible that the expression ( cin >> inBuf ) is true but still
inBuf is empty ?
Kindly explain.
by Stanley Lippman in page 213.
string inBuf;
while (cin >> inBuf && ! inBuf.empty( ) )
{
// do something
}
Here is the condition check ( ! inBuf.empty() ) needed ?
is it possible that the expression ( cin >> inBuf ) is true but still
inBuf is empty ?
Kindly explain.