title: scanf with %8x auto adds 00 at the beginning if user input with 0x?
body: <p>am kinda stuck on how to make it work, I need to get 8 Hex digits from user.and I am trying to get only the first 8 digits if the user enter more than 8 by using </p>
  
  <pre><code>scanf("%8x", iPtr); //iPtr is an int pointer that's why i don't use &amp;.
  </code></pre>
  
  <p>It works if the user does not type: <code>0x</code> at the beginning, but if they enter: <code>0xffffffffffff</code>
  the result of iPtr is: <code>0x00FFFFFF</code>
  It auto add 2 <code>0</code>s in front of the <code>F</code>s...</p>
  
  <p>if i only use <code>%x</code>, it will work fine but getting the last 8 digits instead. and i want the first 8 digits...</p>