I would be grateful for help in solving the following.In lippman C++ primer 4th edition page p289 I am unable to figure out how to correct this code to run without continously looping. I think lippman's definition of clear() on page 288 is incorrect; I think it should read:
clear() clears all flags and set state flags to the argument given. I have tried clear() instead of clear(istream::failbit) to no avail. To avoid another endless loop note that on page 321 code at bottom of page :
first =v.insert(first, 42) should read v.insert(++first,42).