title: How to convert string to hex value in C
body: <p>I have string "6A" how can I convert into hex value 6A?</p>
  
  <p>Please help me with solution in C</p>
  
  <p>I tried </p>
  
  <pre><code>char c[2]="6A"
  char *p;
  int x = atoi(c);//atoi is deprecated 
  
  int y = strtod(c,&amp;p);//Returns only first digit,rest it considers as string and
  //returns 0 if first character is non digit char.
  </code></pre>