Ok so what I'm trying to do, is take an infix notation string ex.(3+5/6) an turn it into postfix ex(3 5 6 / +). The thing is I have to account for incorrect characters which is anything other than an int, or one of the operators (/ * - + %). I go through with the if/if else statements checking for each, and there is an else statement at the bottom of that, line 59, that should return invalid if the character isn't in the set of allowed. It will run(incorrectly) if I don't uncomment line 62, but thats what I need to work. It gives me a seg fault, and I don't have a clue why, I don't think it should be....it runs the print statements, and shows that the character is incorrect, but seg faults at line 62. Any ideas...? The equation it is stuck on is (2 $ 2) - should return "invalid"
Generally a segfault means that you corrupted memory and you were just lucky enough to have done it in a way that causes the segfault instead of your program continuing in a corrupted state.
Since you're getting the segfault on return statements, I would guess that you're corrupting the memory of one of the variables you create in your function, so that when the destructors try to release the memory you get the segfault. I'm not sure what exactly it is, though, I'd need to look over the code more thoroughly.