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

I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

749


What do you mean by a sequential access file?

793


What is the best way to store flag values in a program?

754


What is the general form of function in c?

768


Explain about block scope in c?

835


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

775


explain what are actual arguments?

810


How can I manipulate strings of multibyte characters?

795


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

1444


What is a program flowchart and explain how does it help in writing a program?

943


What is the use of a ‘’ character?

788


What are the various types of control structures in programming?

790


List some applications of c programming language?

718


What are the 3 types of structures?

752


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

830