Inputing multiple entries in a 2D array on one line

SteveISTBullit (1) Jul 21, 2011 at 1:24am
I am creating a program that allow the dimensions and values of matrices to be input and then added and subtracted.

I can allow the user to input entries into a 2D array using two 'for' loops but the user cannot visually see the matrix being formed. By this I mean that the user enters the input as:

[1][1]: 23
[1][2]: 54
[1][3]: 67
etc...

but I want the user to be able to input the values to the matrix like this:

[ 23 54 67 ]
[ 64 78 92 ]
etc.

is there any way to write the program so that multiple entries can be input without pressing enter? I want the equivalent of:

cin<<array[1][1]<<array[1][2]<<array[1][3];
cin<<array[2][1]<<array[2][2]<<array[2][3];

but since the width of the matrix is not predetermined I can't see how to do this since I need to use two for loops. Have I explained this well enough?
Topic archived. No new replies allowed.