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
Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene


Project Description: I want an app that the user can download it from the play store and use it as a keyboard for texts and writing. Just like the Samsung keyboard and the arabi

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

A: By keeping along with the C++ tradition of "there's more than one method to do that" (translation: "give programmers options & tradeoffs so they can choose what's best for them

What is inheritance? Class, the vehicle, which is used to execute object-oriented concepts in C++, has given a new dimension to this idea of reusability. Many vendors now offer


simple coding for pebble merchant..

a c program to find the volume of sphere

Should my constructors employ "assignment" or "initialization lists"?