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

What is a rooted hierarchy?

1161


How java is different from c and c++?

1197


What is the use of namespace std in C++?

1069


What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number

1272


Is oops and c++ same?

1047


What do the header files usually contains?

1053


C is to C++ as 1 is to a) What the heck b) 2 c) 10

1057


Do inline functions improve performance?

1067


what is a reference variable in C++?

1237


How do c++ struct differs from the c++ class?

1192


Why c++ is called oop?

1106


What are the benefits of pointers?

1033


What is vectorial capacity?

1161


What is virtual destructor? What is its use?

1073


If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?

1103