43. What Is Static Memory & Dynamic Memory Allocation? Answer: Compiler allocates memory space for a declared variable. By using the address of operator, the reserved address is obtained and this address is assigned to a pointer variable. This way of assigning pointer value to a pointer variable at compilation time is known as static memory allocation. A dynamic memory allocation uses functions such as malloc() or calloc() to get memory dynamically. If these functions are used to get memory dynamically and the values returned by these function are assigned to pointer variables, such a way of allocating memory at run time is known as dynamic memory allocation. 44. What Is Dynamic Memory Allocation? Explain The Various Memory Allocation Function With Its Task. Answer: The mechanism of allocating required amount of memory at run time is called dynamic allocation of memory. Sometimes it is required to allocate memory at runtime. When we declare array in any program, the co...
All HR and Technical interview questions with answers for freshers and experienced professional. It helps job seekers who are about to attend interviews.