What is static memory allocation and dynamic memory allocation?

What is static memory allocation and dynamic memory allocation?

Information regarding static men\mory allaocaion and dynamic memory allocation are given below:

Static memory allocation: 

The compiler allocates the required memory space for a declared variable.Using the address of operator,the reserved address is obtained and assigned to a pointer variable.most of the declared variable have static memory,this way is called as static memory allocation.
In tis memory is assign during compile time.

Dynamic memory allocation: 

For getting memory dynamically It uses functions such as malloc( ) or calloc( ).the values returned by these functions are assingned to pointer variables,This way is called as dynamic memory allocation.
In this memory is assined during run time.


By:Vivek
Date:2029-12-08 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher