Vidyalelo
C Programming · Q233

Standard Library Functions

Programming · C Programming · question 233

Q233

Point out the error (if any) in the following C code? #include #include int main(void) int* p = NULL; struct S *s = NULL; void(*f)(int, double) = NULL; char *ptr = malloc(15); if (ptr == NULL) printf("Out of memory"); free(ptr);

A.
Error in the statement: void(*f)(int, double) = NULL;
B.
Error in the statement: char *ptr = malloc(15);
C.
Error in the statement: struct S*s = NULL;
D.
No error
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board