strtol using errno

前端 未结 4 1892
有刺的猬
有刺的猬 2021-01-16 09:21

I have the following code:

#include 
#include 
#include 

void main(void)
{
     int data;
     char * tmp;
            


        
4条回答
  •  粉色の甜心
    2021-01-16 09:51

    You have to set errno to 0 before you call strtol. Otherwise you overwrite whatever value strtol set errno to.

提交回复
热议问题