Welcome to pickSourcecode.com Login | Register    
pickZy.com
 Home  | search  | games  | General  | C  | C++  | Java  | Php  | Networking  | Visual Basic  | VC++  | Win32  | MFC  | JavaScript  | Jobs  | JavaScript  | Post jobs
What are storage qualifiers in C++ ?       Share
2008-10-23 |  mathuramchristhuoss  | Viewed: 1319  |    0

What are storage qualifiers in C++ ?

They are..

const
volatile
mutable

Const keyword indicates that memory once initialized, should not be altered by a program.

volatile keyword indicates that the value in the memory location can be altered even though nothing in the program
code modifies the contents. 
for example if you have a pointer to hardware location that contains the time, where hardware changes the value of this pointer variable and not the program. The intent of this keyword to improve the optimization ability of the compiler.   

mutable keyword indicates that particular member of a structure or class can be altered even 
if a particular structure variable, class, or class member function is constant.

struct data
{
char name[80];
mutable double salary;
}

const data MyStruct = { "Satish Shetty", 1000 }; 
//initlized  by  complier

strcpy ( MyStruct.name, "Shilpa Shetty"); 
//  compiler  error
MyStruct.salaray = 2000 ; 
//  complier  is  happy  allowed


Latest topics
The Preprocessor  Viewed: 303
Type Casting  Viewed: 306
What is conversion constructor?  Viewed: 311
Input/Output Library  Viewed: 314
Definition of OOP:  Viewed: 315
Objects  Viewed: 316
What is Multiple Inheritance?  Viewed: 321
What is Message passing  Viewed: 327
Differentiate between the message and method?  Viewed: 332
What are C++ storage classes?  Viewed: 333

Comments:





Submit comment's

Type:

User Comment's:

Submitted By:
Prof: Software
Tech: C ,Cpp
Send Mail: jmcdoss_05



Related topics
Cpp - c++ interview tips
Cpp - c++ Destructors
What is Encapsulation?
What is Data Abstraction?
What is Inheritance?
What is Polymorphism?
What is Message passing
What is Extensibility?
What is Persistence?
What is Delegation and Genericity?
What is Multiple Inheritance?
Basic concepts of OOPS and Structure of C++ program
what is memory leak?how to avoid that?
When are copy constructors called?
What are all the implicit member functions of the class?

Related References
cpp - pointers in c++
cpp - how to use dll file in the c++ program
cpp - creating and linking dll files to c++ program
cpp - append c++
fibonacci series - c++ - cpp
c++ - factorial sample program
binary search cpp program , c++ samples and tutorials
cpp lexicographical_compare sample program
reversecompare cpp example

Web site contents © Copyright 2007, All rights reserved.
Help | Terms and Conditions | Privacy Policy | About Us