title: Why does this print only 0?
body: <p>New to C, I've been trying to convert a hex input with this code. The input argv[1] I've been giving it is 0xabcd123. It has only given me 0 outputs. I have also tried using atoi as well as varying the types of outputs. Why does it only print 0? Here is the code, thanks</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  typedef union{ 
      double num; 
      float f; 
  } U;
  int main(int argc, char*argv[])
  {   
  
  U u;
  u.num = strtod(argv[1], NULL);
      printf("%e\n", u.f);
  return 0;
  }
  </code></pre>
  
  <p>result is platform dependent!</p>