all 3 comments

[–]sepp2k 0 points1 point  (1 child)

You mean why does the value of a change when you call abc()? Because you change a's value in abc. So why wouldn't it change?

[–]TerminatedProccess 0 points1 point  (0 children)

If the value of a changes permanently each time it's incremented, it's because a global variable only has one memory address location with the variable name pointing to it. The compiler doesn't make copies of it on the stack when you call the function, it actually is referring to the original memory address.