I need to convert my string into int array. so i make a loop over string, and call int atoi(char *p) function from stdlib.h, but it doesn`t working on mac (some times ago i tryed it on Windows, and it workong well). simple loop:
for(p = buff; *p; p++)
printf("%d", atoi(p));
whats the problem with work of this function, u think?
The function is working perfectly fine. For instance if
buffcontains"123", your code will print123233.However it seems you want to just print the value of individual digits, in which case
atoihas nothing to do with your problem. Try: