WorksheetsMemory allocation
Total questions: 8
Worksheet time: 4mins
Which header file is mandatory for DYNAMIC MEMORY ALLOCATION
stdio.h
math.h
stdlib.h
dos.h
What is correct about calloc() function?
Allocates the space for elements of an ARRAY
initialize the elements to 0
If the space is insufficient then return NULL pointer
ALL of these
calloc and malloc function is used for
dynamic memory allocation
static memory allocation
Both static memory allocation and dynamic memory allocation
ALL
void * malloc(size_t n) returns
Pointer to n bytes of uninitialized storage
NULL if the request can be satisfied
Nothing
All
Which of the following is static memory allocation
Array
stack
linked list
ALL
In function free(p), p is a
int
Pointer returned by malloc()
Pointer returned by calloc()
Pointer returned by malloc() & calloc()
Memory allocation using malloc() is done in?
Static area
Heap area
Stack area
Both Stack & Heap area
Which one is used during memory deallocation in C?
free(p);
terminate(p);
delete(p);
remove(p);
