Ok, I have a saved file with the following information saved in binary format.
My goal is to be able to read the file 1 char at a time,and when it reaches the '*' it puts a cout<<"\n"; in to make a new line. However, I am having trouble dealing with the primary code.
When I try to read the file, it comes out like this.
(I have it set to display 1 char at a time, then show the whole thing)
after, it displays...
*2222 (only the last char is read.
one thing to note is that to just get the basics running, the program will only read the first 5 characters.
I could use some help getting this thing to work.
char ch ='\0';
char * buffer;
char * character;
readfile.seekg (0, ios::end);
length = readfile.tellg();
readfile.seekg (0, ios::beg);
character =new char[length];
buffer[b] = new char;
cout <<buffer <<k <<endl;
cout << "Load succesful";
//cout <<character[length] <<endl;
Can you post:
1) representation of the data in the file you read from
2) representation of the data you want to output
thanks, but don't worry about it, I decided that I would just have the program make a new file for every person, like a game's save function. That should cut down on the amount of binary file navigating I have to do :D