Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. bool imatrix()
  2. {
  3. int row, col, i, j;
  4. int** matrix;
  5. cout << "Number of rows ? ";
  6. cin >> row;
  7. cout << "Number of columns ? ";
  8. cin >> col;
  9. matrix = new int*[row];
  10. for (i = 0; i < row; i++)
  11. matrix[i] = new int[col];
  12. for (i = 0; i < r; i++)
  13. {
  14. cout << "Row " << (i + 1) << " ? ";
  15. for (j = 0; j < c; j++)
  16. {
  17. cin >> matrix[i][j]; //<-- here i want input to be on same line
  18. } // but it forces the cursor on new line
  19. cout << "n";
  20. }
  21. return true;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement