Saturday, 28 September 2013

How to get indexes for values in array

How to get indexes for values in array

I need to write a function that takes as argument 2d array. Each element
of array has an Integer value. As input i have a 2D array for example:
[1][1][2][2]
[2][1][2][2]
[3][3][3][3]
[22][.......
and as output I need to store indexes for each value :
value = 1 : [0,0] ; [0,1] ; [ 1,1]
value = 2 : [1,0] ; ....
value = 3 : [2,0] ; .......
value = 22 : [.........
Size of array may be various, same as number of values. Is it somehow
possible to save that data to vector, or any other data type so later i
could read those values and their indexes?
Sorry if something is unclear, Its my 1st post here:) Cheers

No comments:

Post a Comment