Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What are the volatile variables and where are they used?

Status
Not open for further replies.

ramdabade

Newbie level 2
Joined
Jul 25, 2005
Messages
2
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,303
valatile

Hi, can anybody please tell me about volatile variables and where they are exactly used?
 

valatile variables

search google for C volatile and you will find literally millions of hits, many quite good.

Also try the Search button here.
 

Re: valatile variables

see here:




Mik
 

valatile variables

c++ compiler optimize code by using allocating
the cpu registers to variables. keeping frequently used variables in registers improve the performance. programmer can also
provide hint to compiler by declaring a variable as register (using register keyword).

the qualifier volatile tells the compiler “You never know when this will change,” and prevents the compiler from performing any optimizations based on the stability of that variable. Use this keyword when you read some value outside the control of your code, such as a register in a piece of communication hardware. A volatile variable is always read whenever its value is required, even if it was just read the line before.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top