title: convert HEX string to Decimal in arduino
body: <p>i have an Hex String like this : "0005607947" and want to convert it to Decimal number , i test it on <a href="http://www.rapidtables.com/convert/number/hex-to-decimal.htm" rel="nofollow"><strong>this site</strong></a> and it correctly convert to decimal number and answer is : "90208583" but when i use this code i get wrong value !
  where of my code is wrong or did have any one , some new code for this problem ?</p>
  
  <pre><code>long int decimal_answer = getDEC("0005607947") ;
  
  long int getDEC(String str110) {
     long int ID = 0 ;
     int len = str110.length() ;
     char buff[len] ;
     int power = 0 ;
  
     for(int i = 0 ; i &lt;len ; i++) {  buff[i] = str110.charAt(i); }
  
     for(int i = (len-1) ; i &gt;=0 ; i--) { 
        int num = buff[i] - '0' ;
        ID = ID + num * pow(16 , power) ;
        power = power + 1 ;   
       }
      Serial.println(String(ID , DEC));
    return ID ;
  }
  
  
  
  // thanks , i also use this but , get error : invalid conversion from 'void*' to  'char**' [-fpermissive]
  unsigned int SiZe = sizeof(F_value) ;
  char charBuf[SiZe];
  F_value.toCharArray(charBuf , SiZe);
  
  long decimal_answer = strtol(charBuf , NULL , 16);
  Serial.println(decimal_answer , DEC);
  </code></pre>