how to put high scores in a c++ game?

can somebody help me please?

thanks in advance!
I would define a simple structure to hold name and score, then a simple class to hold a number of such structures - probably using one of the STL container classes.
You then need to add methods to check a new score against the set of high scores in the class (so you can aleart the user they have a new high score), to add a new high score & name to the list, and to load and save the list to a file on disk (assuming you want the high scores to be preserved from game to game).
If you need more help, post what you manage yourself and I'm sure someone will give you a few more hints :-)
Last edited on
Thanks for your response.
Can you kindly please post some of the syntax so I can understand it fully?
Because I'm not really good in computers, it's just that our curriculum has this c++ thing. So I have to take this course.


Thanks in advance!
See http://www.cplusplus.com/doc/tutorial/classes.html fro more on Classes and structures.
See http://www.cplusplus.com/reference/stl/list/ for info on the STL list class, which should do as the container class yuo need.
See http://www.cplusplus.com/doc/tutorial/files.html for more on input and output with files.
Read up on these and have a go - you will learn much more that way, and the folks here will help with problems you have with any code you post.
Topic archived. No new replies allowed.