Although yours works cire it doesn't display the line stone which I need to be displayed. K0t4k0t4 is the best I've seen so far, either way thank you both for sharing your insight.
Although yours works cire it doesn't display the line stone which I need to be displayed. K0t4k0t4 is the best I've seen so far, either way thank you both your insight.
I don't see much point in making it work for a one-off difference if it doesn't also work for an arbitrary difference, nevertheless:
^Note that eof is not set until AFTER you have tried to read and failed so you will print out two copies of the lines at the end. That is why cire was looping on the getline()s themselves; they will return false when they fail, meaning you will not get the duplicates at the end of the file.
on the test files he provided it does not produce duplicates on the last line on my system. Im not trying to argue that its correct i would actually never program it this way for a real use i was simply shooting for the smallest loop that produced the same output as the original for this case.