It is necessary to read from the binary file the numbers that are on even positions. You need to use seekg (), but how can it work, can you explain? What you need to put instead of dots?
while (!f.eof()) { f.seekg(........, ios::beg); } It is necessary to read from the binary file the numbers that are on even positions. You need to use seekg (), but how can it work, can you explain? What you need to put instead of dots?
while (!f.eof()) { f.seekg(........, ios::beg); } The ios::beg modifier sets the pointer to a position from the beginning of the stream. And you need to use ios::cur to shift from the current position. If after reading it is shifted by 1 from the current position, then the parity of the position will not change.
Total
f.seekg(1, ios::cur); Source: https://ru.stackoverflow.com/questions/612655/
All Articles