When changing array value, it puts a random value, and not the one I specify

So I am creating my first RPG game for fun. And I am working on the movement of the player.

Right now I have an array board[x][y] that creates the game board, and then I have a player move function that changes the arrays value to a special ascii char. But once it attempts to change the value, it inserts a crazy value to all of the arrays and makes the values all wonky random characters.

Would anyone help me try to solve this? Not sure why its doing what its doing.

here is the main.cpp

here is the class gameboard.cpp and gameboard.h

here is the class hero.cpp and hero.h

Learn debugging. It's essential. With it, you will be able to solve problems by your own. Debugging lets you spot bugs with the use of breakpoints and watches.
Then, if you have a specific question, you can of course ask in the forums.
Last edited on
Thanks for the reply, I didn't think there was 'debugging' outside the program as long as it compiled with no errors.

Would you mind pointing me in the right direction for debugging?

Thanks again
You may want to search on google something like (let's say your IDE is Code::Blocks):
"code blocks"+"debugging" tutorial
The differences between the various IDEs are not that big for what concerns the basic functionalities of the debuggers, so you may even read a generic tutorial to start.
Last edited on
Topic archived. No new replies allowed.