Hi, I have the following code:

Qt Code:
  1. if (a != b) {
  2. if (c != 0 && a_vec[c-1] == b) {
  3. cout << "a is not longer equal to b" << endl;
  4. }
  5. }
  6. else if (c == 0 || a_vec[c-1] != b) {
  7. cout << "a is now equal to b" << endl;
  8. }
To copy to clipboard, switch view to plain text mode 

Here, a is a normal variable, b is a constant and c is an index that starts at 0 and is increased by one between everytime this code runs. I think that I should get each other "a is not longer equal to b" and each other "a is now equal to b" in cout, but everything I get is "a is now equal to b". When I run the debugger, I put breakpoints at rows 1, 2 and 7 in this code. The strange thing is that when the code breaks at row one, I press F10 to see where the program heads next. First, it moves to row 2. When I press it again, it does not enter the if clause and goes to row three, but it jumps directly to row 7! How is this possible? How can it take that strange jump directly from row 2 to row 7? There would be no way it go move there without getting caught at some other break point, unless there is some bug in the debugger, right?

I'm using Qt Creator 2.3.1 based on Qt 4.7.4 (32 bit). The compiler is MinGW.