Bloomberg Interview Question

What is "static" mean in the c++?

Interview Answers

Anonymous

Mar 7, 2010

Static 1. Within a function, there is one copy of the variable that retains its value even when the function returns. 2. Within a class, all objects share the static variable and the static variable is accessed using the class name. 3. In the global scope a static variable is local to the current file. http://msdn.microsoft.com/en-us/library/s1sb61xd(VS.80).aspx

3

Anonymous

Feb 5, 2010

i think this requires lots of explanation, i just explained how "static" keyword works on declaring the function.

1

Anonymous

Mar 3, 2010

Was probably looking for you to mention it's allocation at the start of the program, one copy in memory, etc.