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?
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 |
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is the average salary of a c++ programmer?
What are inline functions? What is the syntax for defining an inline function?
class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so here qustion is both function either function overloading or over riding;
What is the use of map in c++?
Live example for static function?
What is encapsulation in C++? Give an example.
0 Answers HAL, Honeywell, Zomato,
Which format specifier is used for printing a pointer value?
What is the difference between an external iterator and an internal iterator?
What is searching?
Differentiate between a pointer and a reference with respect to c++.
What are the advantages of c++ over c?