Hey there.
What I'm trying to accomplish is simply. A user enters the input '2 1 3 18' (not including the quotes)
and all 4 numbers are put into an array.
This is my code thus far (note variables are set up properly etc the only issue I'm having is saving the input)
Also running the code line for line, the first time cin.getline() is run I'm unable to enter anything.Code:for (int i = 0; i < m; ++i){ counter = 0; while (counter < n){ cin.getline(input, 100, ' \n'); //so either a space or a new line is like pressing enter aMatrix[i][counter] = (int)input; //I wanted to put (long double)input; but that doesn't work - any ideas? counter++; } }
Thanks in advance!




Reply With Quote