Suppose you to insert or get the values from 1d array using 2d dimensions like :-
Insert value at (1,2) and the value is 5 then you have to find the logic to get the index :-
Firstly you have to know the size of 2d array here suppose :- (2x3)
int xPosition = 1;
int yPosition = 2;
3 is ySize of 2d array.
int 1dIndex = (3*xPosition)+ yPosition ;
Insert at this index or get from this index.
Insert value at (1,2) and the value is 5 then you have to find the logic to get the index :-
Firstly you have to know the size of 2d array here suppose :- (2x3)
int xPosition = 1;
int yPosition = 2;
3 is ySize of 2d array.
int 1dIndex = (3*xPosition)+ yPosition ;
Insert at this index or get from this index.