I am coding a text RPG, and am trying to implement options to 'move north', 'move south', and so on. I have a 10x10 struct (I should add code to prevent the player from hitting the wall later) and it works by leaving one variable alone and modifying the other positively or negatively. I am unsure of how I should do this.
(I have all the integers within a struct. It's huge, so I left that out. I'm positive I'm calling it right. I also left out north and south to reduce the amount of code. They are identical except for the variable being modified and which operator is used.)
Firstly, if you write int, it usually means you're declaring something (it could also be a cast or template argument, but that's for later..). Here you have nothing to declare.
The plan should be to have a player class that has members x and y. As you move add + or -1 to either. Also have a map array. When you want to know about the place the player is in, you can check map[player.x][player.y].hasMonster or etc.