Examveda

Point out the error (if any) in the following C code?
#include <stdlib.h>
#include <stdio.h>
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: Option D


This Question Belongs to C Program >> Standard Library Functions

Join The Discussion

Related Questions on Standard Library Functions