GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 41 of 209    Print  
What are the different types of Storage classes?

  
Total Answers and Comments: 4 Last Update: December 28, 2007     Asked by: suji 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: michaelpyles
 
Volatile is not a storage class.  A storage class defines where the value of the variable is stored. 
Volatile tells the compiler that the variable may be modified by code that is not apparent to the compiler... so therefore, don't get smart and try to optimize it away.

Above answer was rated as good by the following members:
bobsEmc2
September 28, 2005 00:44:39   
Lily        

RE: What are the different types of Storage classes?
There are four types of storage class: automatic register external and static.
 
Is this answer useful? Yes | No
July 25, 2007 14:36:51   
Prabhuram Jagadeesan        

RE: What are the different types of Storage classes?
Storage class defined for a variable determines the accessibility that is what portion of the program could have access to the variable and also the longevity of the variable that is how long the variable would exist.



Different types of storage classes variable in C++ are:



Automatic

External

Static




http://www.exforsys.com/tutorials/c-plus-plus/storage-classes-in-c.html

 
Is this answer useful? Yes | No
August 10, 2007 09:35:50   
susant chandra sarangi        

RE: What are the different types of Storage classes?

Along with these 4 type auto ststic extern and register we can add "volatile"


 
Is this answer useful? Yes | No
December 28, 2007 22:38:22   
michaelpyles Member Since: December 2007   Contribution: 3    

RE: What are the different types of Storage classes?
Volatile is not a storage class. A storage class defines where the value of the variable is stored.
Volatile tells the compiler that the variable may be modified by code that is not apparent to the compiler... so therefore don't get smart and try to optimize it away.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape