convert char array to int array
Hi, im having a bit of trouble with getting my string converted into an array of ints, as i am quite new to c.
Basically the program reads in user input (which is only integers) as a string or array of chars, and i want to change it to an array of integers and print it out again. Heres what i have so far..
Code:
int main() {
char num1[255];
int num10[255];
int i;
int j;
fscanf(stdin, "%s", num1);
j = strlen(num1);
for (i = 0; i < j; i++){
num1[i] == num10[i];
printf("%d", num10[i]);
}
}
basically this just prints out an array filled with 0's.
any help would be much appreciated.