For some reason, this for loop causes the program to crash RIGHT after the first iteration. No error message, no segfault, just stops working.
myTest is a separate class, v is a vector, both of which have been tested to work fine otherwise. For loops everywhere else in the code work fine too. The if statement is just the first part of what's going to go in there. The code prints out
start
end
And then crashes. I've tested the code within and found that it works correctly, scanning the line and pushing the values into the vector. But for some reason it just completely crashes after the first iteration. I'm completely baffled, any ideas would be greatly appreciated.
UPDATE: getting rid of the sscanf line makes it work, so that's clearly the problem, but I can't for the life of me figure out why. Does sscanf have a habit of screwing anything up?
I may have figured out the problem. It seems having x y and z inside the for loop messes it up. However, it would still be useful to know why. Anyone know?