Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: gh43m on November 20, 2012, 02:00:19 pm

Title: cursor gets back to if statement after execution
Post by: gh43m on November 20, 2012, 02:00:19 pm
Dear friends,
I have written a code and executed it line by line. but when I execute an if statement, the condition is met and the line below if is executed, but the cursor comes back to "if" statement again.
why is this happening??
that part of code is here:

01     if(((sex=='f')||(sex=='F'))&&(age>30)&&(m_status=='s'))
02         bonus=base_salary*0.15;
03    else
04         ogholat=0;
05

I mean, when the condition is met(line 01), the cursor goes to line 2 and after calculation of bonus, it comes back to line 01 again. Of course after coming back to line 01, it jumps to line 5 and the program is working properly, but I am curious to find out why this is happening.
one of my friends told me that it comes back to take the address of line 05 (cuz there is else statement).
What's your idea??
Thanks in advance.

Title: Re: cursor gets back to if statement after execution
Post by: oBFusCATed on November 20, 2012, 02:04:05 pm
Probably some destructor is called. And this is a 'feature' of newer GDB's
Title: Re: cursor gets back to if statement after execution
Post by: jarod42 on November 20, 2012, 02:31:31 pm
I'm agree with your friend:
the 'jump' statement may be associated to the 'if'.