hello srinivasan!
An object's type may have additional qualifiers.Declaring an object const announces tht its value willn't b changed;declaring it *volatile
announces tht it has special properties relevant to optimization.niether qualifier affects the range of values or airthemetic properties of the object.
type qualifiers:
# const
# volatile
Type qualifier may appear with any type specifier.A const may be initialized,but not thereafter assigned to.There are no implementation -independent semantics for volatile objects.
const &volatile properties are new with the ANSI std.
purpose of *const - is to announce objects tht may be placed in read-only memory,& perhaps to increase opportunities for optimization.
The purpose of *volatile* -is to force an implementation to suppress optimization tht could otherwise occur.For example,
for a machine with memory mapped input/output,a pointer to a device register might be declared as a pointer to volatile,in order to prevent the compiler from removing apparently redundant refrences through the pointer.Except tht it shld diagnose explict attempts to change const objects, a compiler may ignore these qualifiers.
hope this would satisfy your urge for knowledge!! :)