MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which kind of memory can grow and shrink dynamically and unexpectedly?
A
Static
B
Stack
C
Heap
D
both b and c
Explanation: 

Detailed explanation-1: -In C, dynamic memory is allocated from the heap using some standard library functions. The two key dynamic memory functions are malloc() and free(). The malloc() function takes a single parameter, which is the size of the requested memory area in bytes.

Detailed explanation-2: -C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely malloc, realloc, calloc, aligned alloc and free.

Detailed explanation-3: -To allocate memory dynamically, library functions are malloc(), calloc(), realloc() and free() are used. These functions are defined in the <stdlib.h> header file.

Detailed explanation-4: -A way or organizing different types of data in the phone’s memory. Also referred to as Shared memory. Dynamic memory means that all types of data are stored in the same memory (there is no separate memory for photos, ringtones etc.).

There is 1 question to complete.