wondering if someone could help on best way to read a file into a buffer in such a way as to be able to set the seek() on the buffer (or file position), and then read from that buffer based on the buffer's (file) position? Instead of using &read() function for every call.
Firstly read a whole file into a buffer.
And then using the buffer, being able to do something like this;
Code:offset = 0; buffer.seekp(offset); buffer.seekg(offset); buffer.read((char*)&cChar,sizeof(cChar)); cout<<"cChar: "<<cChar<<endl;
I'm still relatively new to file i/o, so any help would be great.