What is volatile keyword in embedded C? Explain with example? What is the difference between typedef and #define?
Submitted by: AdministratorThe volatile keyword is used to define memory mapped I/O device's register (or Hardware registers) variables, which indicates to the compiler
For example:
int i;
&i=0x1234;
i = 0;
delay();
if(i){ //Here the Compiler removes this code by optimization
some statements // because 'i' is already assigned with 0 so..
}
if you declare 'i' as volatile then compiler doesn't optimize.
Submitted by: Administrator
For example:
int i;
&i=0x1234;
i = 0;
delay();
if(i){ //Here the Compiler removes this code by optimization
some statements // because 'i' is already assigned with 0 so..
}
if you declare 'i' as volatile then compiler doesn't optimize.
Submitted by: Administrator
Read Online Personal Job Interview Questions And Answers
Top Personal Questions
☺ | Give a specific example of a time when you used good judgement and logic to solve a problem? |
☺ | Explain array? |
☺ | Tell me If there is a fixed deadline given by manager, walk through the steps you would take? |
☺ | What are my weaknesses. I dont really know my weaknesses. I know my strengths. Can you give me some examples of weaknesses? |
Top Basic Job Categories
☺ | Targeted Selection Interview Questions. |
☺ | Business intelligence Interview Questions. |
☺ | Puzzles Interview Questions. |
☺ | Behavioral Interview Questions. |
☺ | Freshers Graduate Interview Questions. |