From bccd7996a00998373052eee6f5950570111eb9be Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Fri, 5 Apr 2019 09:09:01 -0500 Subject: Finally fix problem (Of course it's off by 1) --- ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ee1301') diff --git a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp index 861fbbb..b22a4b2 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp @@ -56,9 +56,9 @@ void getInput(int input[SIZE][SIZE]) { // oldArray: Array generated in getInput of SIZE // newArray: Array of same dimensions and data void makeNewArray(int oldArray[SIZE][SIZE], int newArray[SIZE][SIZE]) { - for (int row = -1; row < maxRow; row++) { - for (int column = -1; column < maxColumn; column++) { - newArray[row][column] = oldArray[row][column]; + for (int row = -1; row < maxRow-1; row++) { + for (int column = -1; column < maxColumn-1; column++) { + newArray[row+1][column+1] = oldArray[row][column+1]; } } } -- cgit v1.2.3