Pergunta de entrevista da empresa Intel Corporation

When the keyword static is used in C?

Respostas da entrevista

Sigiloso

15 de jul. de 2015

1. If a variable is defined as static within a function, it retains the value when the function is called multiple times. 2. If a variable is defined as static outside a function, it is global within the module. 3. If a function is defined as static, it can be used only within the module.

2

Sigiloso

2 de abr. de 2010

To preserve the value of a variable across functions calls.

1

Sigiloso

29 de mar. de 2012

Also when the variable or function is restricted to the file.