how i can put 2d array to a pointer? In the below program i am giving a first value to output_bit and then start to a loop and putting the new values to an another array as called newdata[l][k]. But as i understand from this loop the last value of the 2d array u[l][k] is not put to newdata[l][k]. Because of the first value of output_bit which is given in he beginning. In 1d array it is easy to solve this problem that you can put output_bit data in the for loop to the new data as newdata[k-1] but 2d array it is not possible to do this. So how can i solve this problem?????? Thanks for your interest.....
output_bit=0
for (l = 0; l < K; l++) {
for (k = 0; k < K; k++) {
if (u[l][k] == 0)
output_bit =1 - output_bit;
newdata[l][k] = output_bit;
}}
output_bit=0
for (l = 0; l < K; l++) {
for (k = 0; k < K; k++) {
if (u[l][k] == 0)
output_bit =1 - output_bit;
newdata[l][k] = output_bit;
}}
Comment