#include #define MAXNAME 15 void say_hello(char *user) { /* Say hi to the user */ printf("Hello %s!\n", user); } int logging(char *user, int count) { /* Print a log message */ printf("Logging (id: #%d): %s said hello ", user, count); /* Logging succeeded */ return 1; } main() { int counter; char *name, *tmpname; /* Allocate memory for and get the user name */ name = (char *) malloc(MAXNAME); (void) gets(name); /* Logging */ tmpname = name; logging(tmpname,counter); free(tmpname); /* Greet the user */ say_hello(name); /* Free used memory */ free(name); }