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
i havea a small C++ i need help with. should not be anything special for an experienced programmer


Q: How can Define an Array? An Array is defined in much the alike manner as ordinary variables except that every array name must be accompanied by a size specification (that is

WAP TO PRINT ANY NAME ON SCREEN 10 TIMES void main () { int a=1; clrscr(); do { printf ("expertsmind\n"); a++; } while (a getch (); }

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

WAP TO PRINT SERIES FROM 1 TO 10 & FIND ITS SQUARE AND CUBE # include stdio.h> # include conio.h> # include math.h>   void main () { int a=1,sqr=0,cube=0;

A: In C, encapsulation was completed by making things static in a compilation unit or module. It prevented another module from accessing the static stuff. (Incidentally, now static

Determine the types of Container class Container class can be of 2 types: - Heterogeneous container - Here container class comprise a group of mixed objects - Homogeneou

Problem #1: plugging the memory leak. When you employ the "normal" new operator, for example Foo* p = new Foo(), the compiler generates some special code to manage the case while t

i am a engineering student and am working on a project in audio processing and so i have designed a FIR filter in Matlab . how can i get my Matlab program converted to C program?