1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdlib.h> #include <stdio.h> void say_hello() { printf("say_hello: address of function malloc() is :%p\n", malloc); char *buf = malloc(1024); if(NULL != buf) { snprintf(buf, 1024, "%s", "hello\n"); printf("%s", buf); } }