Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool imatrix()
- {
- int row, col, i, j;
- int** matrix;
- cout << "Number of rows ? ";
- cin >> row;
- cout << "Number of columns ? ";
- cin >> col;
- matrix = new int*[row];
- for (i = 0; i < row; i++)
- matrix[i] = new int[col];
- for (i = 0; i < r; i++)
- {
- cout << "Row " << (i + 1) << " ? ";
- for (j = 0; j < c; j++)
- {
- cin >> matrix[i][j]; //<-- here i want input to be on same line
- } // but it forces the cursor on new line
- cout << "n";
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement