Creating an atoi function

后端 未结 5 1669
感情败类
感情败类 2021-01-19 04:03

I\'m attempting to create my own atoi function. With the following I\'m getting a return value of 0. Whatever I change the number variable within the function is what I get

5条回答
  •  遥遥无期
    2021-01-19 04:48

    Since number is supposed to be a char array,

    • you should declare it as char number[MAXSIZE];,
    • you shouldn't call your function with &number but with number, directly : atoi_me(number);

提交回复
热议问题