answersLogoWhite

0

When you declare a const you provide a guarantee to the compiler that the value will never be changed by your program; the value is constant. All constants are implicitly static, so they are always allocated in the program's data segment rather than on the stack.

When you declare a variable as being volatile, you are stating to the compiler that the memory referred to by that variable is not under the direct control of your program and that external processes may change the value at any time.

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

What is difference between volatile int and const volatile int?

volatile int means the code and fom outside from code can changes the value but in const volatile int, code cannot changes the value but fron ouside can change the value


What is qualifier in c?

short, long, long long signed, unsigned const, volatile


How can a variable be characterized?

name, type, storage class, other attributes (const, volatile), value, address


What is a lighting device which employs the uses methylated or volatile fuels such as alcohol instead of oil called?

spirit lamp


Is a Ram a volatile?

RAM is a volatile Memory. But ROM is not volatile.


What is the difference between inline and const?

Everything. "inline" refers to functions, "const" refers to variables.


What is volatile and non volatile soluts?

volatile will evaporate


What is a volatile and non volatile solute?

volatile will evaporate


How do you declare a constant Explain it with a suitable example?

Declaring a Constant: We can declare a constant using the keyword "const". E.g. const abc='a';const number=10; const number[10]={1,2,3,4,5,6,7,8,9,10}; const name[7]={'K','U','N','D','A','N'}; #include<stdio.h> #include<conio.h> void main() { int i; const name[7]={'K','U','N','D','A','N'}; for(i=0;i<7;i++) { printf("%c",name[i]); getch(); }


What is the three major parts of a pascal program?

-var,const,uses declaration part could start with uses in case of a declaration for a libr ex. (uses crt) var,const refers to those used in the main probram -functions,procedures declaration part declaration of the function/procedure + content ex. (function one(x:integer):integer; var y:integer; begin ...... one=....(integer expresion for return value); ...... end;) the procedures don't have any return value (:integer) -main program begin ........ end.


What is the prototype of printf function?

in stdio.h:extern int printf (const char *fmt, ...);


Is dram a volatile or non volatile?

DRAM is a volatile memory