I wrote a blackjack game for class and one stipulation is to have a file(fstream). I did get the file stream to work but not like it should. it keeps track of player name and money amount. what i would like to do is give player option to save game. i am confused on how to go about reusing the data from the file. user enters name and program should see if name is in record. then the user can start with the money amount that was saved previously. i was thinking of using string compare but i do not want to change the variable that i am using. (it didn't work anyway). how can i use string compare and access the saved record with the variable being the same name?
cap2361 0 Newbie Poster
Pikachu 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.