int a[] = {1,2,3,4,5}, This is
static allocation
dynamic allocation?
Answers
Answered by
15
Answer:
it is dynamic allocation
Explanation:
this is the answer of your question
Answered by
0
int a[] = {1,2,3,4,5} – Static Memory Allocation is right.
Explanation:
- Static memory is allocated at the time of compilation so it can’t be changed at the time of execution.
- Our program is executing so, we can not increase or decrease the size of allocated memory because it is fixed .
- This is an advantageous to use in the case our requirement because it is fixed.
- But when our requirement is dynamic so, the allocation size needs to be changed as per our requirement .
- At time of compilation or execution than we prefer dynamic memory allocation over static memory allocation.
Example :
- Dynamic Allocation:
memory allocated using malloc()
int *ptr;
- Static Allocation:
Array
int arr[10] ==>
Project code #SPJ2
https://brainly.in/question/42049527?referrer=searchResults
https://brainly.in/question/22887649?referrer=searchResults
Similar questions