As I stated in my comment, your loop condition is wrong. while (!readin.good()) ...
stackoverflow.com