Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are the basics of classifying different storage types,
why?

Answer Posted / prit

The different storage types in C++ are
Auto: all the variables declared in C++ are of the type
auto by default
The scope is limited to the loop

int temp; //is by default of type auto

Register: tels the C++ compiler to allocate some storage in
the registers.They are supposed to be faster then other
storage types.

register int var;

Only nonstatic&#65292; local variables may reside in registers&#65292;
and C++ uses the same rules for register variable scope and
initialization as it does with automatic variables

Mutable:const memebre functions or data types can be
modified using mutable keyword.

mutable int i;

static:static variable is declared as a member of a class,
then it will preserve the value for all the objects of the
class.i.e, one copy of this data variable will be shared by
all objects of the class.

static int temp;

extern : extern keyword is used to specify that the
variable is declared in a different file.Used mostly to
declare global scope

extern int num;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Discuss the possibilities related to the termination of a program before entering the mainq method?

956


Describe the advantages of operator overloading?

1048


Can a constructor return a value?

1265


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

1083


What is std namespace in c++?

1187


What is an undefined reference/unresolved external symbol error and how do I fix it?

1124


How to allocate memory dynamically for a reference?

1049


When should we use multiple inheritance?

1051


How did c++ start?

1095


Is c++ high level programming language?

1141


What are the defining traits of an object-oriented language?

1210


What is scope in c++ with example?

1113


What is array in c++ pdf?

1194


What is the difference between the functions rand(), random(), srand() and randomize()?

1292


What are the advantages of using const reference arguments in a function?

1077