atoi函数的问题,在线=char *a= "6a82 "; long int b; b=atol(a); 执行结果是6;后面的 a82 不见了 如何才能得到6a82 [解决办法]a 是个字符窜 包含有非数字的char 你怎么把他转成int型呢?[解决办法]使用 strtol char *a= "6a82 "; long int b; b=strtol(a,NULL,16); 16表示使用16进制进行转换.