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
Can a copy constructor admit an object of the similar class as parameter, rather than reference of the object?

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

kirchoff''s law

Prepare a script for providing Instagram Followers/Likes I need to prepare a panel where my customer able to get Instagram followers or likes automatically. - A panel where I


Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

Write a c program to determine interchanged values between two variables?[Hint - if loop] What will be the output of the program? How many times this loop will execute? Wr

Threaded binary tree: Consider the linked illustration of a binary tree 'T.  Approximately half of the entries is the pointer fields 'LEFT' and 'RIGHT' will have null elements. Th

find the occurence of zy in the final string

T o k e n :  Tokens  are  small  entities  in  a  program.    Example: identifiers,  keywords,  constants, operators, strings, etc.  These tokens are used almost in same wa