Question 1 of 25
Hints left: 3
Q1
What does the 'sizeof' operator in C return for a dynamically allocated array?
Q2
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); }
Q3
What is the difference between 'malloc' and 'calloc' in C?
Q4
What is the maximum number of bytes that can be allocated using 'malloc' in C?
Q5
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); }
Q6
Array is preferred over linked list for the implementation of . . . . . . . .
Q7
In C, what is the purpose of the 'realloc' function?
Q8
Which function is used to free allocated memory but does not remove the pointer in C?
Q9
What is a segmentation fault in C?
Q10
What happens if you attempt to free the same block of memory twice in C?
Q11
With every use of a memory allocation function, what function should be used to release allocated memory, which is no longer needed?
Q12
What is a memory fragment in C?
Q13
What is the difference between 'free' and 'delete' in C?
Q14
In C, what is the purpose of the 'calloc' function?
Q15
The free() function frees the memory state pointed to by a pointer and returns . . . . . . . .
Q16
Which of the following is an example for non linear data type?
Q17
Local variables are stored in an area called . . . . . . . .
Q18
How do you check if the 'realloc' function has successfully reallocated memory in C?
Q19
Which function is used to allocate memory for a structure in C?
Q20
When the pointer is NULL, then the function realloc is equivalent to the function . . . . . . . .
Q21
What is the primary advantage of using dynamic memory allocation in C?
Q22
Which function is used to release all dynamically allocated memory in C?
Q23
Which function is used to allocate memory for an array of character strings in C?
Q24
The number of arguments for realloc() function is/are:
Q25
In C, which function is used to allocate memory from the stack?