Line 47 isn't giving both digitsfor and digitsafter values: the problem is in your variable j. First you're going up (j++) and then down (j--) so all values for digitsfor and digitsafter will be the same but the swapt (eg 321,123).
Your second question is hard to answer but easy to solve: the problem is that using both getline and cin (line 87) gives problems. You shouldn't use cin>> at line 87 anyway, since sN a short integer and entering characters into an integer will make the program crash. See Zaita's article about getline:
http://www.cplusplus.com/forum/articles/6046/.
Furthermore, I have a few suggestions:
- make result from type BigNumber and add the memberfunction add() to that class. Now you've created a class to handle big numbers, and when using a bignumber (result) you're using other solutions.
- I think it's easier to use a memberfunction print() instead of extract(), aldo it wouldn't make much difference
- make sValue a parameter from store(): always try to hold membervariables in private.
- use the following sequence for digitsfor: 5 4 3 2 1 0, and for digitsafter: 0 1 2 3 4 5. You'll find this usefull when printing and storing the values.
- about storing the value: you should first take the first element of the string and see or it's a '-'. Maybe it's smart to create another membervariable from type bool to see or the value is positive or negative. Then split the string into a string for ''." and after. You can use string.find(".") to do this. When you figured that out, you can use two for-loops to initialize the values.
- in main(), add() should be inside the for-loop I think
There may be some other problems I missed, but first try to get those things straight.