Point out the error (if any) in the following C code? [code]#include <stdlib.h> #include <stdio.h> int main(void) { int* p = NULL;

Khánh Đoan

New member
Point out the error (if any) in the following C code?
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
 

Tìm kiếm

Back
Top