Pergunta de entrevista da empresa Bloomberg

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

Respostas da entrevista

Sigiloso

7 de mar. de 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

Sigiloso

5 de fev. de 2010

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

1

Sigiloso

3 de mar. de 2010

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