How do I switch chars at certain indexes of a char array?
Lets say I have a char array maze[][] and it contains this:
P . X X .
. X . . .
. . . X .
X X T . .
. . X . .
And I am writing a function that if you want to move down, will bring "P"
from maze[0][0] to maze[1][0] and then bring "." from maze[1][0] to
maze[0][0] and so on...
Basically how do I trade the values at 2 indexes in a char array?
No comments:
Post a Comment