Storage Classes
- Why do we write (int *) before malloc?
int *ip = (int *)malloc(sizeof(int));
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
It is for the type-casting
- Memory allocation using malloc() is done in _________
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Heap area
- Why do we write (int *) before malloc?
int *ip = (int *)malloc(sizeof(int));
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
It is for the type-casting
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *ptr = calloc(200, 2);
ptr = "Interview Mania";
printf("%s\n", ptr);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Interview Mania
- Which of the following is used during memory deallocation in C?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
free(p);