Q. where is the below variables stored ?
- volatile, static, register




Answers were Sorted based on User's Feedback



Q. where is the below variables stored ? - volatile, static, register..

Answer / kiruthikau

local variables-->stack
global variable-->data memory
register variable-->CPU registers
static variable-->main memory


Volatile is a type qualifier not a storage class specifier.
So it does not determine storage location.

When we declare a variable as volatile the compiler will
examine the value of the variable each time it is
encountered to see if an external factor has changed the value.

Is This Answer Correct ?    11 Yes 3 No

Q. where is the below variables stored ? - volatile, static, register..

Answer / banavathvishnu

Qualifier Storage
========= ========

1. static Data area

2. register CPU register, if CPU register are
busy with some other work, it will be treated as local and
will be stored on stack

3. Volatile is just a qualifier it does not change the
storage class, if it defined volatile var as global it will
be stored in data area, and if it defined in a funciton it
will be stored in stack.

Is This Answer Correct ?    3 Yes 4 No

Q. where is the below variables stored ? - volatile, static, register..

Answer / c p

local variables-->stack memory
global variable-->global or static memory
register variable-->CPU registers
static variable-->global and static memory
(stack memory+(globel memory or static memory)+heap memory)=DATA MEMORY

Is This Answer Correct ?    0 Yes 3 No



Post New Answer



More C Interview Questions

Meaning of () in c

1 Answers  


can v write main() { main(); } Is it true?

6 Answers  


What is the Lvalue and Rvalue?

2 Answers  


write a programe returns the number of times the character appears in the string

2 Answers  


pgm to reverse string using arrays i.e god is love becomes love is god) (assumption:only space is used for seperation of words) no addtional memory used.i.e no temporary arrays can used.

4 Answers   Persistent, Valyoo,






In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

0 Answers  


How to implement variable argument functions ?

1 Answers   HP,


If the static variable is declared as global, will it be same as extern?

1 Answers   Samsung,


int i=0,j; j=++i + ++i ++i; printf(" %d",j);

2 Answers   ME,


what is the difference between declaration and definition of a variable or function ?

3 Answers  


How to reverse alternate words in a given line of string For Eg: my name is narasimha output : my eman is ahmisaran

0 Answers  


which of the following statements is incorrect a.typedef struct new{ int n1; char n2; } DATA; b.typedef struct { int n3; char *n4; }ICE; c.typedef union { int n5; float n6; } UDT; d.#typedef union { int n7; float n8; } TUDAT;

5 Answers   Assurgent, TCS,






Categories