C Programming :: Memory Allocation
-
Point out the error in the following program.
#include#include int main() { int *a[3]; a = (int*) malloc(sizeof(int)*3); free(a); return 0; } -
Point out the error in the following program.
#include #includeint main() { char *ptr; *ptr = (char)malloc(30); strcpy(ptr, "RAM"); printf("%s", ptr); free(ptr); return 0; }

Whatsapp
Facebook