Described storage qualifiers in c++ ?, C/C++ Programming

A: They are following:

Const: point out that memory once initialized, must not be modify through a program.

Volatile: denote that value in the memory location can be modified although nothing in the program code changes the contents. For instance: if you have a pointer to hardware location which contains the time, where hardware modifies the value of this pointer variable and not the program. The intent of this keyword is to get better optimization capacity of the compiler.

Mutable: Denote that particular member of a class or structure can be changed 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

 

Posted Date: 3/21/2013 7:25:56 AM | Location : United States







Related Discussions:- Described storage qualifiers in c++ ?, Assignment Help, Ask Question on Described storage qualifiers in c++ ?, Get Answer, Expert's Help, Described storage qualifiers in c++ ? Discussions

Write discussion on Described storage qualifiers in c++ ?
Your posts are moderated
Related Questions
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B

Question 1 Explain the following Object Oriented Concepts with suitable examples for each Question 2 Explain the following Object Oriented Methodologies Question 3 Descr

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw

#include "stdafx.h" #include iostream using namespace std; int _tmain(int argc, _TCHAR* argv[]) {             int NumbHold[5];             int * ptrNumb;

Question 1 Write a program that accepts a 3x3 matrix from the user and finds the transpose of it Question 2 Explain Brief about class and objects. Also describe friend functi

Operation on array: void Array::add( Object& toAdd ) {     lastElementIndex++;     while( ptrAt( lastElementIndex ) != ZERO &&            lastElementIndex

#quesdifferentiate betweenrelocatable and self relocating program with exampletion..

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

create algorithm for doubly link list using c data structure