- Memory Allocation - General Questions
- Memory Allocation - Find Output of Program
- Memory Allocation - Point Out Errors
- Memory Allocation - Point Out Correct Statements
- Memory Allocation - True / False Questions
- Memory Allocation - Yes / No Questions


Memory Allocation - Programming
Q1: Point out the error in the following program.
#include<stdio.h>
#include<stdlib.h>
int main()
{
char *ptr;
*ptr = (char)malloc(30);
strcpy(ptr, 'RAM');
printf('%s', ptr);
free(ptr);
return 0;
}
A Error: in strcpy() statement.
B Error: in *ptr = (char)malloc(30);
C
Error: in free(ptr);
D No error
ANS:A - Error: in strcpy() statement. Answer: ptr = (char*)malloc(30); |


For help Students Orientation
Mcqs Questions
One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.