> C++ understanding code?

C++ understanding code?

Posted at: 2014-12-18 
This should be it:

5 7 23

f(z, x+y)

1. line 27 declares static int w, inits to 11

2. line 28 sets w to 22

3. line 29 adds 3 to main's z (first argument, passed by ref)

4. line 31 adds 22 to global x

27 7 26

f(y, y*z)

1. line 27 does nothing because static w is kept from last call

2. line 28 sets w to 44

3. line 29 adds 3 to main's y (first argument, passed by ref)

4. line 31 adds 44 to global x

71 10 26

Hey all, I am trying to understand this code:

http://ideone.com/mOHRZk

Can someone explain the following, especially the first one:

what outputs through every call and why?

What is the lifetime of variable w and z?

Thanks for any help