the code below compiles but when I try to run it, it crashes and says "segmentation fault", please help.
insertCode:#include <string.h> #include <time.h> #include <stdio.h> char* get_time(); main () { char *c; c = get_time(); printf("%s\n", c); return 0; } char* get_time() { char *buffer; time_t curtime; struct tm *loctime; curtime = time (NULL); loctime = localtime (&curtime); strftime (buffer, 30, " %d/%m/%Y %I:%M:%S\n", loctime); printf("%s\n", buffer); return buffer; }