From 8047f7ceadebae1afbd8d45e00bf203b04f9fe07 Mon Sep 17 00:00:00 2001 From: Matthew Strapp Date: Tue, 2 Apr 2019 16:30:00 -0500 Subject: Update strap012_HW5C.cpp --- ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp index bfd6709..d2d599f 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp @@ -22,16 +22,17 @@ int main() { void getInput(int input[SIZE][SIZE]) { string test; + //I would mainly like to thank some random person on StackOverflow for solving my problem while (getline(cin,test)) { istringstream ss(test); - string temp; - while(getline(ss,temp,' ')) + string foo; //foo is only needed in this one scope and will not be named further. + while(getline(ss,foo,' ')) maxRow=0; { - input[maxRow][maxColumn] = stoi(temp); + input[maxRow][maxColumn] = stoi(foo); maxRow++; } maxColumn++; } cout << maxRow << " " << maxColumn << endl; -} \ No newline at end of file +} -- cgit v1.2.3