title: sending hexadecimal values in c and check it for bit set
body: <p>I am working on socket programming in Linux.Client is sending the below given hexadecimal values.I have to recieve the values on server side and check 8,9,10 and 11th hexadecimal values that which bits are set..
  I am using following code but it's printing some weired output.
  Please help me with this..</p>
  
  <p>CLIENT:</p>
  
  <pre><code>void infostate(int sockfd,int confd)
  {
  char responsedata[]={0x7E,0x11,0x01,0xD0,0x00,0x4E,0x2F,0x0F,0x0F,0x70,0xFF,0xF5,0x25,0xF3,0x0D};
  int rc;
  rc=send(sockfd,responsedata,sizeof(responsedata),0);
  if(rc&lt;0)
  {
      perror("error in sending\n");
      close(confd);
      close(sockfd);
      exit(-1);
  }
  else
  printf("data successfully send\n");
  }
  </code></pre>
  
  <p>SERVER</p>
  
  <pre><code>void identifycmd(char command[],int acceptsd,int sd)
  {
       if(command[11]=='8' &amp;&amp; command[12]=='3')
  {
      char responsedata[14];
      rc=recv(acceptsd,responsedata,sizeof(responsedata),0);
      if(rc&lt;0)
      {
          perror("error in recieving\n");
          close(acceptsd);
          close(sd);
          exit(-1);
      }
              printf("the response data is\n");
              for(i=0;i&lt;sizeof(responsedata);i++)
              {
                      printf("%x",responsedata[i]);
               }
               printf("\n");
  
  
      checkretval(responsedata);
      processinfostate(responsedata);
  
  }
  
  
  }
  void processinfostate(char responsedata[])
  {   
  char  z[8];int i,j;
  
  unsigned char mask[]={128,64,32,16,8,4,2,1};
  char x;j=9;
  for(i=0;i&lt;8;i++)
  {
              x=responsedata[j];
      z[i]=(x &amp; mask[i]);
      printf("%c",z[i]);
          j++
  
       }
  
  }   
  </code></pre>