How do I fill the array with keyboard input through a loop so that when assigning an array of values to the elements and pressing Enter, the cursor does not move to the next line? I need him to move to a new line only when all the elements of this line are filled. I hope I clearly stated the problem. Here is a piece of code.
for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { cin >> ar[i][j]; } cout << endl; }