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?

Answers were Sorted based on User's Feedback



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

Answer / sv

Automatic
External
Static
Register

Automatic is local storage applied for local variables.

External is global variable,which shall be accessed through
out the program at any modules.

Static retains its values and live till end of the program,
but not visible to all modules, hence accessible with in
the scope.

Register: In few program, where performance is high
importance we can use register storage, so that access
overhead is less.In this storage type , an varible always
uses the register for read/write.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / 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

More C++ General Interview Questions

What are function prototypes?

0 Answers  


Specify different types of decision control statements?

0 Answers  


What is the oldest programming language?

0 Answers  


Can I learn c++ without knowing c?

0 Answers  


Write a program which employs Recursion

0 Answers  


What are Virtual Functions? How to implement virtual functions in "C" ?

3 Answers  


What is an orthogonal base class in c++?

0 Answers  


What is an Iterator class?

1 Answers  


What is copy constructor? Can we make copy constructor private in c++?

0 Answers  


Why ctype h is used in c++?

0 Answers  


show that among any group of five (not necessary consecutive ) integers, there are two with the same remainder when divided by 4.

1 Answers  


What is &x in c++?

0 Answers  


Categories