#include "string.h" #define INVALID_VALUE_LXX ((1 << (8 * sizeof(int) -1)) - 1) /*有符号整型最大值,假设越界将为0, and - is prioty of <<*/ #define A2a(ch) (('a' <= (ch) && (ch) <= 'f') ? (ch) : ((ch) - 'A' + 'a')) bool is0to9(char ch) { if ('0' <= ch && ch <= '9') { return true; } else { return false; } } bool isatoF(char ch) { if (('a' <= ch && ch <= 'f') || ('A' < ch && ch <= 'F')) { return true; } else { return false; } } int a2iLxx(char* ch) { int index = 0; int retVal = 0; bool flag = false; if (NULL == ch) { return INVALID_VALUE_LXX; } /*Ox*/ if ('0' == ch[0] && ('x' == ch[1] || 'X' == ch[1])) { index = 2; for (; ch[index] != '