- #1
TheSourceCode
- 14
- 0
I need to take the values from a string , such as {23 45 67\0}, and store them into an int array. I need to do this with atoi() and isdigit() but I'm having some issues. Here is what I have.
Code:
for(i=0; i<=n; i++){
num[i]=atoi(str);
for(j=0; (isdigit(str[j])!=0); j++){
for(k=0; k<n; k++)
str[k]=str[k+1];
n-=1;
}
for(j=0; j<n; j++)
str[k]=str[k+1];
n-=1;
}