关键代码: sscanf( "0x4988E348AED3C" , "%I64x" , &nValude );
关键是 64位的支持
void strTest() { char* p = "0x4988E348AED3C"; char* str; __int64 i = strtol(p, &str, 16); printf("%d ", i); { char* p = "0x4988E348AED3C"; __int64 nValude = 0; sscanf( "0x4988E348AED3C" , "%I64x" , &nValude ); //sscanf(p, "%x", &nValude); printf("%lld ", nValude); } }