What is volatile

Answer Posted / ravi.jnv

Volatile is to inform the compiler that not to optimise
code.
for ex:
int a = port1;
int b = port1;
int c = port1;

compiler may convert it as
int a=b=c=port1;

so avoid it , u have to use volatile keyword.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different file extensions involved when programming in C?

765


Do string constants represent numerical values?

930


Are c and c++ the same?

629


What are extern variables in c?

552


What is pointer to pointer in c with example?

556






Explain how do you list a file’s date and time?

621


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1501


Are the variables argc and argv are local to main?

793


Difference between strcpy() and memcpy() function?

684


how is the examination pattern?

1600


Can we use visual studio for c?

556


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

3694


What is the use of a ‘’ character?

589


What is string length in c?

618


Can stdout be forced to print somewhere other than the screen?

627