what is volatile in c language?

Answer Posted / selvakumar vedhachalam

It is nothing but telling to compiler that this variable
will change its value at anytime by means of anything and
compiler should not make any assumption about this variable.

Normally compiler will assume that some variable will be
constant during runtime. This may lead error in checking a
registor value repeatedly. Because the register value may
be changed by anything. So for these kind of variables
should be declared 'volatile' and it be checked each time
appears in the code with out any assumption.

Is This Answer Correct ?    135 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the advantage of a random access file?

640


Is file a keyword in c?

504


Write a program to reverse a given number in c language?

621


Is array name a pointer?

607


What is the use of a conditional inclusion statement in C?

603






What kind of structure is a house?

558


What is main return c?

520


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

651


while initialization of array why we use a[][2] why not a[2][]...?

1869


Explain what is the difference between the expression '++a' and 'a++'?

628


When should I declare a function?

624


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1254


What is sizeof return in c?

618


Which header file is essential for using strcmp function?

946


What is string in c language?

628