1. /*  
  2. in:  
  3.  *pnum: the address of data to convert  
  4.  *size:size of the data  
  5.  *modify:to add some decorate  
  6.  */   
  7. void printBinary(char* pnum,int size=1,bool modify=true){  
  8.     for(int i=size-1;i>=0;i--){  
  9.         for(int j=7;j>=0;j--){  
  10.             if((*(pnum+i))&(1<<j))cout<<"1";              
  11.             else cout<<"0";  
  12.             if(modify&&j==4)cout<<"-";  
  13.         }  
  14.         if(modify)cout<<" ";  
  15.     }