input question

let say if i put the number

Input//

4 4 <-----------int value
x x x y
x y x x
x x x x
y y y y



if i input this i want board[x][y] is fill up with x and y
How do u write "cin" with depend on int value?


let say if input is 3
cin >> x1 >> x2 >> x3;

its really hard to explain...
why not do a for loop and store the results in a vector?
1
2
3
for (int r = 0; r < x; ++r)
   for (int k = 0; k < y; ++k)
      cin >> x;
Topic archived. No new replies allowed.