viduus
August 31st, 2007, 12:18 AM
For the life of me I can't remember how to separate the individual numbers from a larger number. Essentially what I am trying to do is read a file that has a list of 1000 numbers back to back. I am probably going about it the wrong way, but so far what I have tried to do is input the whole thing into a string and then read the individual numbers by stringName[i].
The problem from there occurs when I try to translate stringName[i] to an integer. Eg-> atoi(stringName[i])
The resulting error says its an invalid conversion from char to const char.
My question then is, is there a simpler way to separate a long list of numbers (eg-> 454545 ) into a linked list or even an array?
eg:
array[0] = 4
array[1] = 5
array[3] = 4
The problem from there occurs when I try to translate stringName[i] to an integer. Eg-> atoi(stringName[i])
The resulting error says its an invalid conversion from char to const char.
My question then is, is there a simpler way to separate a long list of numbers (eg-> 454545 ) into a linked list or even an array?
eg:
array[0] = 4
array[1] = 5
array[3] = 4