I think we need more code to analyze this. If the program is less than about 250 lines, post it with line numbers:
[code=cplusplus] // paste code here
[/code]
That way there's no guesswork. The problem could be in the string-reversal, the negative handling, the absolute value handling, etc. If it's a big program, post a fragment, but a COMPLETE fragment please, so we can run it.
Is there a reason you don't just convert the strings to integers and subtract normally, or is this an assignment where you are supposed to do it digit by digit?
I am suppose to be able to add numbers upto 100000 digits with negative signs.
Here is what I have so far..
// Make a new substraction function that goes from right to left instead of left to right.
// - start at (len - 1) eg. If (len == 5) then start at 4. If (len == 10) then start at 9
// - make your way left towards zero
// You can't just substract one from the number left to it, you have to make sure that you find a number that is bigger than
// '48'... Then add ten to next number and then continue.....
#include<iostream>
#include<string>
#include<iomanip>
#include<algorithm>
using namespace std;
int absolute(int input) // Takes in a number and returns the absolute value of that number.
{
if (input >= 0)
{
input = input;
}
else if (input < 0)
{
input …