I'm trying to cin an undefined number of coords (x,y,weight) on 1 single line. Exemple:
Please enter all the coords:
(1,2,5) (1,5,7) (2,5,2) (2,4,4) (2,3,5) (3,4,1) (4,5,9)
I will stock them in a 2d array, so for my first coord it would be something like:
array[1][2] = 5
If it was only a single coord per line, I would do something like:
cin >> trash_char >> x >> y >> weight >> trash_char;
array[x][y] = weight
How can I do that for an undetermined amount of coords on a single line?
Thanks guys!