我需要将我的字符串转换为int数组.所以我在字符串上循环,并调用int atoi(char *p)函数stdlib.h,但它不能在mac上工作(有些时候我在Windows上试过它,它工作得很好).简单循环:
int atoi(char *p)
stdlib.h
for(p = buff; *p; p++) printf("%d", atoi(p));
你认为这个功能的工作有什么问题吗?
c macos xcode
c ×1
macos ×1
xcode ×1