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
http://pastebin.com/UAn5KGUP

here is the class gameboard.cpp and gameboard.h
http://pastebin.com/Fy0aQiuA
http://pastebin.com/31H5A0VK

here is the class hero.cpp and hero.h
http://pastebin.com/6AdD2Jk2
http://pastebin.com/CkBp0y7Y

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.