?
Point out the error (if any) in the following C code?
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);
}
#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);
}
Join the Discussion
Login to post a comment or share your explanation.
Login