Question 1 of 25
Hints left: 3
Q1
In C, what is the purpose of the 'realloc' function?
Q2
Which function is used to release all dynamically allocated memory in C?
Q3
Which of the following is an example for non linear data type?
Q4
In C, what is the purpose of the 'calloc' function?
Q5
What is the difference between 'free' and 'delete' in C?
Q6
What is the maximum number of bytes that can be allocated using 'malloc' in C?
Q7
Which function is used to allocate memory for an array of character strings in C?
Q8
Which function is used to free allocated memory but does not remove the pointer in C?
Q9
What does the 'sizeof' operator in C return for a dynamically allocated array?
Q10
What will be the output of the following C code? #include<stdio.h> #include<stdlib.h> void main() { char *p = calloc(100, 1); p = "welcome"; printf("%s\n", p); }
Q11
How do you check if the 'realloc' function has successfully reallocated memory in C?
Q12
Which function is used to allocate memory for a structure in C?
Q13
What is the primary advantage of using dynamic memory allocation in C?
Q14
When the pointer is NULL, then the function realloc is equivalent to the function . . . . . . . .
Q15
What is a memory fragment in C?
Q16
The number of arguments for realloc() function is/are:
Q17
Local variables are stored in an area called . . . . . . . .
Q18
The free() function frees the memory state pointed to by a pointer and returns . . . . . . . .
Q19
With every use of a memory allocation function, what function should be used to release allocated memory, which is no longer needed?
Q20
What happens if you attempt to free the same block of memory twice in C?
Q21
Array is preferred over linked list for the implementation of . . . . . . . .
Q22
What is a segmentation fault in C?
Q23
What is the difference between 'malloc' and 'calloc' in C?
Q24
In C, which function is used to allocate memory from the stack?
Q25
What will be the output of the following C code if the input entered as first and second number is 5 and 6 respectively? #include<stdio.h> #include<stdlib.h> main() { int *p; p=(int*)calloc(3*sizeof(int)); printf("Enter first number\n"); scanf("%d",p); printf("Enter second number\n"); scanf("%d",p+2); printf("%d%d",*p,*(p+2)); free(p); }