aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk5
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ee1301/wk5/hw5_directory/strap012_HW5C.cpp6
1 files changed, 3 insertions, 3 deletions
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];
}
}
}