title: IP address input in C
body: <p>I want to write a program in C which is taking input IP Address from user and then i want to do some bit operations on it. How can i take input in bits in C. I tried the below code but integer is of size 2 bytes, which makes the complete address here of 8 bytes(64 bits). When using char to scan input, its losing the value entered. Is there any way to take input in bits( i want 32 bits IPv4 address in 32 bits only and 128bit V6 in 128 bits only).</p>
  
  <pre><code>    unsigned short int a,b,c,d;
  scanf("%d.%d.%d.%d", &amp;a,&amp;b,&amp;c,&amp;d);
  printf("%d\t%d\t%d\t%d\t", a, b, c, d);
  </code></pre>
  
  <p>Thanks in advance.</p>