ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2264)
 C++ interview questions  C++ Interview Questions (1119)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (648)
Question
how the compiler treats any volatile variable?Explain with 
example.
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
A volatile variable is one whose VALUE CAN CHANGE
UNEXPECTEDLY. Consequently, the compiler can make NO
ASSUMPTIONS about the value of the variable. In
particular, the optimizer must be careful to RELOAD the
variable every time it is used instead of holding a copy in
a register.
Examples of volatile variables are:

(a) Hardware registers in peripherals (e.g., status
registers)
(b) Non-stack variables referenced within an interrupt
service routine.
(c) Variables shared by multiple tasks in a multi-
threaded application.

Source: 10 Best Questions to would-be Embedded Programmers -
By Nigel Johns
 
Is This Answer Correct ?    5 Yes 0 No
Daniboy
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?   1
Print all the palindrome numbers.If a number is not palindrome make it one by attaching the reverse to it. eg:123 output:123321 (or) 12321 HCL 7
write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC HCL 2
WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?   4
list the no of files created when c source file is compiled TCS 9
HOW DO YOU HANDLE EXCEPTIONS IN C? AppLabs 2
write a c program to convert fahrenheit to celsius? TCS 4
Find occurence of a character in a sting. TCS 3
What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); } ADITI 5
How to use c/c++ code in JAVA Satyam 10
write a c program to print the next of a particular no without using the arithmetic operator or looping statements? TCS 1
Find the largest number from the given 2 numbers without using any loops and the conditional operator.   2
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com