User forums > Help
Debugging Question
(1/1)
GJC:
Why does the debugger stop/break at code within 'if' statements when conditions are not met.?
Hopefully i am doing something strange or incorrectly but would appreciate any help. For example
every time i run in debug mode the debugger breaks within statements that aren't met such
as
if (x==5)
{
y++; //with a breakpoint here
}
the compiler/debugger stops everytime even tho x != 5
Seronis:
I'm sorry but using the following test program i was not able to reproduce your problem.
--- Code: ---#include <iostream>
using namespace std;
int testFunc() {
int x = 10;
if( x == 5 ) {
int y;
y = 9; //breakpoint set here
}
return x;
}
int main() {
cout << "Hello world!" << endl;
return testFunc();
}
--- End code ---
MortenMacFly:
--- Quote from: GJC on September 04, 2009, 11:09:59 am ---if (x==5)
{
y++; //with a breakpoint here
}
--- End quote ---
If "x" is a float or double (so not an integer) this behaviour is correct.
Neverteheless - if you want help post the whole program so we are able to reproduce. Otherwise I can oly say: It works well for me.
Navigation
[0] Message Index
Go to full version