C examples for Memory:malloc
The malloc() function is part of the standard library <stdlib.h> and takes a number as an argument.
Basic malloc() use is demonstrated in the next program.
#include <stdio.h> #include <stdlib.h> int main()/*from ww w . j a v a2 s . co m*/ { char *name; name = (char *)malloc(80); }