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 ?    12 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

write a own function for strstr

1 Answers   LG Soft,


What is the meaning of && in c?

0 Answers  


get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement

3 Answers  


program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.

3 Answers  


main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output?

9 Answers   Ramco,


what is the advantage of software development

1 Answers  


#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?

4 Answers   IIIT,


Explain the ternary tree?

0 Answers  


How can I change their mode to binary?

0 Answers  


Are local variables initialized to zero by default in c?

0 Answers  


What is strcpy() function?

0 Answers  


program to find the ASCII value of a number

8 Answers  


Categories