From c6ece1220be62a09b342bb5e568e46b5013f4221 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Thu, 4 Apr 2019 18:57:21 -0500 Subject: Fix oopsie --- ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ee1301/wk5/hw5_directory') diff --git a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp index 1b1d10d..bc42aa7 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp @@ -35,15 +35,15 @@ int main() { void getInput(int input[SIZE][SIZE]) { string test, temp1; int temp2=0; //I would mainly like to thank whatever user on StackOverflow solved my problem - while (getline(cin,test)) { - temp2 = -2; + while (getline(cin,test,'\n')) { + temp2 = -1; istringstream ss(test); while(getline(ss,temp1,' ')) { temp2++; input[maxRow][temp2] = stoi(temp1); } if (temp2>maxColumn) { - maxColumn = temp2+2; //2 is added to make the math work. + maxColumn = temp2+1; //1 is added to make the math work. } maxRow++; } -- cgit v1.2.3