Search code examples
cconditional-statementsincrementtemporary

C conditional increment


Consider the following code: int a=0 , b=1 If (a == --b) Printf b

Is b now 0 or 1? In other words- is the increment temporary or not?

Thank you!


Solution

  • Yes, b=0 now. And the decrement is permanent within the scope of the function you have defined b in.