自己写函数阿.你要的话,我可以给你我写的.
[email protected]

解决方案 »

  1.   

    int HexToInt(const char* phex)
    {
    int hi,lo;
    if(::isdigit(*phex))
    hi = *phex-'0';
    else
    hi = *phex-'A'+10;
    if(::isdigit(*(phex+1)))
    lo = *(phex+1)-'0';
    else
    lo = *(phex+1)-'A'+10;
    return hi*16+lo;
    }
    ////使用的时候是这样的
    int i = HexToInt("2F");///注意,这里传递的字符串应该大写,
    对于小写的处理,你可以自行添加。
    对于一大串字符串,你可以分隔开来,再一个一个处理。
      

  2.   

    有标准的C函数:
    sscanf //include <stdio.h>
     
    example:
    char onestrin[]="23ad";
    int c;
    sscanf(onestring,"%x",&c);//c=0x23ad