View Single Post
  #2 (permalink)  
Old February 14th, 2004, 04:28 AM
[email protected] vishal_gpt@yahoo.com is offline
Registered User
 
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote