title: To store the hex value entered in command line onto integer
body: <pre><code>#include&lt;stdio.h&gt;
  int main(int argc,char* argv[]){
          int hex;
          printf("\n argc : %d argv[1] : %s \n",argc,argv[1]);
          hex = argv[1];
          printf("\n hex : %x \n",hex);
          return 0;
  }
  </code></pre>
  
  <p>o/p:</p>
  
  <pre><code>[root@ld]# ./a.out 343ed4
  
   argc : 2 argv[1] : 343ed4
  
   hex : 9e1a4aa8
  </code></pre>
  
  <p>I wanted to store the hex value got from the command line argument and store it on the integer. The above program , when stored the hex value gives a different result from the user given value.
  Cant use atoi too as it would cut of the alphabets after the numbers. How to store the hex entered in the command line arguments into an integer.</p>