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 |
write a own function for strstr
What is the meaning of && in c?
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
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.
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output?
what is the advantage of software development
#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?
Explain the ternary tree?
How can I change their mode to binary?
Are local variables initialized to zero by default in c?
What is strcpy() function?
program to find the ASCII value of a number