I don't know where to put this but... I need help with my nooby simple program that crashes. I'll attach it and if you happen to know Cpp it would be LOVLY if you could help. :)
....wow I should have said this: The crash happens whenever the math function gets a string with multiple operators. For Example, 1+1 works, but 1+1+1 will crash. Also I think there is another problem with parenthesis, which are handled in the solve function, that cause it to crash.
In the second loop through in the addition part of the math function, mathstring = "21" with no '+' between them, which due to the lack of a '+' or '-' even though (addition>0), It will crash. I believe you mistakenly remove all of them '+' and '-' characters, when you should only remove the first. I am still looking, And am not sure if this is the cause yet.
Also, I recommended you remove all spaces from the string in math, as "1 + 1" crashes as well.
I don't know where to put this but... I need help with my nooby simple program that crashes. I'll attach it and if you happen to know Cpp it would be LOVLY if you could help. :)
@grenegg: Go
Should I run it...
EDIT: Paste the code here. I'm at work.
@Vexal: Go
http://www.sc2mapster.com/paste/3689/
EDIT: Huh wait, arn't you 5? (:D)
Can you give a more specific description of what the crash is. When it crashes. So I don't have to read through every single line guessing.
....wow I should have said this: The crash happens whenever the math function gets a string with multiple operators. For Example, 1+1 works, but 1+1+1 will crash. Also I think there is another problem with parenthesis, which are handled in the solve function, that cause it to crash.
In the second loop through in the addition part of the math function, mathstring = "21" with no '+' between them, which due to the lack of a '+' or '-' even though (addition>0), It will crash. I believe you mistakenly remove all of them '+' and '-' characters, when you should only remove the first. I am still looking, And am not sure if this is the cause yet.
Also, I recommended you remove all spaces from the string in math, as "1 + 1" crashes as well.