wow thanks! i just took 48 from the number it converted and it printed out the original. thanks heaps
Type: Posts; User: skeme
wow thanks! i just took 48 from the number it converted and it printed out the original. thanks heaps
ohh i see. well then i guess i was going down the wrong track, because what i really want is each of the digits split up into an array of ints. so if i get a number 200 digits long i cant store that...
ok so i had a look at using atoi() and didnt get very far. here is what i did in my for loop.
for (i = 0; i < j; i++) {
k = atoi(num1[i]);
num10[i] = k;
printf("%d", num10[i]);
}
ok thanks, i see what your saying. i guess the next question would be, if lets say the user input was a string of 1234, how do i get to print an integer array of 1234?
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...