title: Incompatible Types in Assignment Between Two Char Arrays
body: <p>I have a char array that is in hexidecimal format "0d76" and I want to convert it to decimal format but I get an error:</p>
  
  <pre><code>incompatible types in assignment of 'int' to 'char [(((sizetype)(((ssizetype)size) + -1)) + 1)]'
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>const char input[] = "0d76";
  int size = strlen(input);
  char hex_array[size];
  for(int i = 0; i &lt; size; i++)
  {
     if ('0' &lt;= input[i] &amp;&amp; input[i] &lt;= '9') 
     {
         hex_array = input[i] - '0';
     } 
     if ('a' &lt;= input[i] &amp;&amp; input[i] &lt;= 'f') 
     {
         hex_array = 10 + (input[i] - 'a');
     } 
     if ('A' &lt;= input[i] &amp;&amp; input[i] &lt;= 'F') 
     {
         hex_array = 10 + (input[i] - 'A');
     } 
  }
  </code></pre>
  
  <p>The desired output would be if I entered <strong>0D76</strong> I would get <strong>3446</strong> in decimal format.</p>
  
  <p>Similarly if someone has a better way to convert char arrays from hexadecimal to decimal not using any library functions I would appreciate it.</p>