News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

cursor gets back to if statement after execution

Started by gh43m, November 20, 2012, 02:00:19 PM

Previous topic - Next topic

gh43m

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.


oBFusCATed

Probably some destructor is called. And this is a 'feature' of newer GDB's
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jarod42

I'm agree with your friend:
the 'jump' statement may be associated to the 'if'.