Lets say, I have a MxN arrays: int *b; and int **c; where
- values in
bare stored by columns (fromc) and I need to put values fromctob - values in
bare stored by rows (fromc) and I need to put values fromctob
I know that basicly I would do it like that:
j = index / N;
i = index - (j * M);
in order to convert a 1D index into a 2D co-ordinate but have a problem how to implement those 2 cases, 1) and 2)?