Question

I have a very simple question in C++. What is the equivalent of

x = new char[length];
mystream.read(x, length*sizeof(char));
delete[] x;

with seekg to ignore a part of size length of a binary file ?

Thank you very much !

Was it helpful?

Solution

You don't need seekg, just use istream::ignore.


If you insist on using seekg, the way to go is seekg(length, std::ios::cur).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top