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

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

1 Answers  


Explain function overloading and operator overloading.

0 Answers  


What is the difference between = and == in C?

20 Answers   Christ University, Intel,


What is scope resolution operator in c++ with example?

0 Answers  


Is there a new/delete equivalent of realloc?

1 Answers  


How a modifier is similar to mutator?

0 Answers  


When should you use global variables?

0 Answers  


What is the best c++ compiler?

0 Answers  


what is the difference between overloading & overriding? give example.

0 Answers  


Write a program in C++ for Fibonacci series

0 Answers   Axtria, ITC Indian Tobacco Company,


What is the average salary of a c++ programmer?

0 Answers  


What is the purpose of the "delete" operator?

0 Answers  


Categories