I am really in a bind here trying to implement high scores into a console app. I just don't understand file reading and writing. The books I have don't cover it very well. Here's some psuedo code, maybe someone could help me out or send me a sample.
(I _do_ know how to open the file)
[code]
File.open("data.txt", ios:ut | ios::in);
get # of lines
go to the lowest line
if (score > lowest score){
while (money > current line's score){
current line's score = next line up;
}
move everything below current line down one line;
insert score and name in empty line;
if (# of lines == 10){
delete last line;
}
}
Thanks guys!