/* Test pour une: char *fonction() */ #include #include char *heure(char *buffer) { time_t timestamp; struct tm *heure; time(×tamp); heure = localtime(×tamp); sprintf(buffer, "%02d:%02d:%02d" ,heure->tm_hour, heure->tm_min, heure->tm_sec); return buffer; } int main(int *argc, char **argv) { char char_heure[9]; printf("heure: %s\n", heure(char_heure) ); return 0; }