devxlogo

Repositioning a std::fstream Pointer

Repositioning a std::fstream Pointer

Just like the fseek() function of , classes enable you to position the stream’s pointer at an arbitrary location by calling the seekg() member function. For example, you can position it at the file’s beginning after you have read from it:

 #include char c,d;std::ifstream mystream(
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist