I want to rearrange the positions of structure elements on the bases of perm_array.
Code:typedef struct gg{ element d; int group; } gg; gg col_data[16]; int perm_array[4]={2,3,1,0}; int ptr = 9; for (l=0; l<4; l++) { // i need some statement like that but this statement will re write the value of previous structure element col_data[ptr+l]= col_data[ptr+perm_array[l]]; }
How can i rearrange structure element like {ptr+2,ptr+3,ptr+1,ptr+0} ?