C++ primer 4th edition p842 英文版
I have question about a statement on Page 842 in the "Completing the File" sec
tion of C++ primer 4th edition. The statement reads as follows:
"Once we exit the loop, we have read each line and calculated all the starting
offsets. All that remains is to print the offset of the last line. As with th
e other writes, we call seekp to position the file at the end and write the va
lue of cnt."
In my mind, after exiting the loop, we ALREADY "printed the offset of the last
line". As in the program on page 841, it called seekp to position the file at
the end but did NOT write the value of cnt. In my mind, the program is right,
but the quoted statement is wrong.
Am I right?