Just something I dont understand...Lets say you had the follwing data in a file:
cat and mouse
dog and flea
123
fish and bait
bird and worm
456
etc....
if I read in the file as
it doesnt work. But if I write the last line asCode:while (in.getline (str1, MAX,'\n')) { in >> ws; in.getline( str2, MAX,'\n'); in >> ws >> id >> ws >> ws; }
everything is fine. Why is that? There are 2 enter's before the next block of data.Code:in >> ws >> id >> ws;