diff options
Diffstat (limited to 'ee1301/wk5')
-rw-r--r-- | ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 9 |
1 files 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 +} |