hi
use bit wise operators
& and <<
// note declare the integer d as 32bit long integer.
d = 0;
int swap_a[4][32];
for(int i=0;i,4;i++)
{
d =0;
for(int j=0;j<32;j++)
{
d = d << 1; // shift bits left 1 position
d = d | swap_a[i][j];
}
fprintf(dude, "%d", d);
}
// note the resulting the file will contain only the 4 integers
|