Cover image for Qualcomm
Logo

Qualcomm

Empresa activa

Qualcomm

Añadir una entrevista

Pregunta de entrevista

Entrevista de Embedded Software Engineer Device Drivers, Embedded Software Security Engineer

-

Qualcomm

what is volatile, static ? how would it affect if the static keyword used for big array inside a function? what are sections of memory and what kind of variable is stored where?

Respuestas de entrevistas

3 respuestas

1

Just clarify one thing, the static variables within a function are not allocated to the function or thread's stack, instead, they are allocated to BSS area, just like other global variables. so it won't affect their function too much.

jason en

0

static variable is not stored on stack.

kuren en

1

if Volatile used then the compiler dont consider to optimize that variable . Assume that a variable changed at the time of running . But some compiler optimized .to avoid that we use volatile. Static is the keyword which is used to initialized to once that means extra burden for a compiler to keep the variable .and permanantly allocate space in stack.if you diclare static array then stack overflow will occur.

praveen fedrick en

Añadir respuestas o comentarios

Para publicar un comentario sobre esto, inicia sesión o regístrate.