aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-04-05 09:09:01 -0500
committerRossTheRoss <msattr@gmail.com>2019-04-05 09:09:01 -0500
commitbccd7996a00998373052eee6f5950570111eb9be (patch)
treeb34f133a7f5703802a14113f323f0c3c5b8026c8 /ee1301
parent?????? (diff)
downloadhomework-bccd7996a00998373052eee6f5950570111eb9be.tar
homework-bccd7996a00998373052eee6f5950570111eb9be.tar.gz
homework-bccd7996a00998373052eee6f5950570111eb9be.tar.bz2
homework-bccd7996a00998373052eee6f5950570111eb9be.tar.lz
homework-bccd7996a00998373052eee6f5950570111eb9be.tar.xz
homework-bccd7996a00998373052eee6f5950570111eb9be.tar.zst
homework-bccd7996a00998373052eee6f5950570111eb9be.zip
Finally fix problem (Of course it's off by 1)
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];
}
}
}