list<int> BIG_NUMBERS_SUM(char x, char y);
char x, y;
cout<<"First number: ";
cout<<"The second number: ";
list<int> BIG_NUMBERS_SUM(char x, char y) // functia care face toata treaba :))
list<int> number_1; // declararea listelor
list<int>::iterator i1; // declararea iteratorilor
// how can I convert the char arrays to int and then to store the values in those lists?
for(i1 = number_1.begin(); i1!=number_1.end(); i1++)
I want to create a program that add two big numbers (with 1 milion digits).
Well, I want to to that using lists from STL. I want to read the numbers as char arrays and then to convert the char - arrays into integers, and then to store them into those two lists.
I know that atoi() function may help me but I don't really manage how to put every digit of that number in a location of a list. atoi() doesn't work if I want to convert only a character (for instance atoi(x[i]), it works only for the entire string.
Also I tried with assign(atoi(x)) method but it must have two parameters and it doesn't help me very much.
Please excuse my english, I am in a hurry and I hope that one of you might help me.