So the following code compiles with no warnings etc with gcc, but for some reason, the swap code doesn't actually modify the array by swapping the values...What could be going on ...
Here let me post the whole program. You guys are really helpful and I know I'm getting close to making this work, I appreciate it. Code: #include #include #define MAX_FILE_LENGTH 30 #define PUZZLE_SIDE 4 #define EMPTY_SLOT 0 void loadPuzzle(int puzzle[][PUZZLE_SIDE], FILE *fin); int getMove(); void printPuzzle(int puzzle[][PUZZLE_SIDE]); // Prototypes for the needed functions of the game int doMove(int puzzle[][PUZZLE_SIDE], ...
i have two size 5 arrays. the user types in two numbers, the first number represents the index of the first array that will be swapped and the second number represents the index of the second array that will be swapped (these two indexes will be swapped together). so say an array as the numbers [1,2,3,4,5] and the other has the ...