what is volatile in c language?

Answer Posted / s.m.faisal

volatile reduces the optimization .optimization means compiler should not make out that the variable has not changed its value so it reads the value directly from the register.
So while using volatile keyword compiler will directly access the variable from the memory not from the register bcz the value of the variable can be changed outside or inside the program.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How old is c programming language?

760


How main function is called in c?

805


Multiply an Integer Number by 2 Without Using Multiplication Operator

521


What are the disadvantages of external storage class?

781


Is there any data type in c with variable size?

837






Here is a good puzzle: how do you write a program which produces its own source code as output?

821


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

2714


Tell me what is the purpose of 'register' keyword in c language?

806


What the different types of arrays in c?

790


What are enumerated types?

830


What is the difference between struct and union in C?

854


Where we use clrscr in c?

876


What is function in c with example?

817


What is bin sh c?

765


What is a node in c?

720