Answer Posted / chandrashekar kalvacherla
volatile tells the compiler that this variable can get altered by ways that the compiler cannot deduce. As a consequence, the compiler will exclude that variable from optimizations and the code will always fetch the variables content from memory, even if it has done so before (no caching).
Imagine a hardware clock which is mapped into memory. You need some way to tell the compiler: whenever I access that variable (mapped to the hardware clock), I want you to actually fetch the content from there. Otherwise the compiler might just ask the clock once for the current time and use the cached value (in a processor register) throught the rest of the program.
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
Between macros and functions,which is better to use and why?
Explain null pointer.
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
is it possible to create your own header files?
Differentiate between a structure and a union.
Can include files be nested?
What is c preprocessor mean?
Explain what is the difference between the expression '++a' and 'a++'?
Is malloc memset faster than calloc?
Where are some collections of useful code fragments and examples?
What is the difference between a string and an array?
How do you determine the length of a string value that was stored in a variable?
a c code by using memory allocation for add ,multiply of sprase matrixes
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58