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...


Why for local variables the memory required to hold the
variable is allocated from the program stack and for new
its allocated from the heap?



Why for local variables the memory required to hold the variable is allocated from the program sta..

Answer / achal ubbott

* Stack is a kind of data structure where Last In FirstOut
work. Local variables are needed for a short span of time
for immediate processing. So push and pop from stack is
used for them. Now memory is allocated to them in static
time only.

* new() operator allocates memory dynamically. Since
objects are needed for more time, space is taken from heap.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C++ General Interview Questions

Explain the properties and principles of oop.

0 Answers  


Do class declarations end with a semicolon?

0 Answers  


What does catch(…) mean?

0 Answers  


I need to find a specific string between two strings how do I do it?

1 Answers   Infosys,


advantages and disadvantages of using Borland C++ / version 5.

1 Answers  


What is c++ map?

0 Answers  


What is jump statement in C++?

0 Answers   Ericsson,


If I is an integer variable, which is faster ++i or i++?

0 Answers  


What is data type in c++?

0 Answers  


How the V-Table mechanism works?

6 Answers   HP,


write a program that takes two numbers from user that prints the smallest number

2 Answers  


What is pointer to array in c++?

0 Answers  


Categories