hello everyone,
i am trying to implement save,load and replay in my chess game made in c++ console.
i am done with save and load but stuck on replay.
i want every turn to be stored in file and when player asks to replay it should show all turns in order they executed
for this i want my read function to act in this way:
-read first 64 characters(total number of components of chess arrary 8*8) and bring them to board array
-then start from 64teh character to 128th character to show next state of game
-then from 128th to next 64 characters and so on

my problem is that is there any function in c++ that allows me to read from file from one point to other point (provided the points are defined by me )..

ask any questions to clarify more..and plz help

5 Years
Discussion Span
Last Post by Schol-R-LEA

Assuming you are using an ifstream to read the file, then function you want is seekg() , which allows you to set the 'get pointer' in a file stream (the point at which the next read will begin). If you follow that link, it has an example of how it is used.

Edited by Schol-R-LEA: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.