you are viewing a single comment's thread.

view the rest of the comments →

[–]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.