当我使用strtol
函数从文件的这些行中解析长值时,
ffffffff8105b4a5 t send_signal
它只是返回ffffffff
而不是ffffffff8105b4a5
!!!
这是代码:
uint64_t value1;
uint64_t value2;
char *temp = (char *) malloc(100);
fgets(temp,512, fp);
strncpy(line1,temp,16);
value1 = strtol(line1,NULL,16);
printf("str_hex1 = %x\n",value1);
printf("str_hex2 = %x\n",value2);