Q. where is the below variables stored ?
- volatile, static, register
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
what are the files which are automatically opened when a c file is executed?
What is the use of pointers in C?
0 Answers Impetus, Motorola, Tavant Technologies, Virtusa,
how many keywords do C compile?
7 Answers Microsoft, Practical Viva Questions,
Explain command-line arguments in C.
Why is event driven programming or procedural programming, better within specific scenario?
How do i store a paragraph into a string? for example, if i input a long paragraph, the program will read the words one by one and concatenate them until no word is left.
What is the use of void pointer and null pointer in c language?
Can a file other than a .h file be included with #include?
how to generate the length of a string without using len funtion?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Can you write a programmer for FACTORIAL using recursion?
What does *p++ do?