Check this program
ifstream filein(\"Hey.txt\"); filein.getline(line,99); cout<
According to the C++ reference (here) getline sets the ios::fail when count-1 characters have been extracted. You would have to call filein.clear(); in between the getline() calls.
ios::fail
filein.clear();
getline()