/* Standard functions that return many values normally do it by returning a struct or, as in this case, a pointer to a struct. */ #include #include int main(void) { time_t now; struct tm *x; time(&now); x = localtime(&now); printf("year %d\n",(*x).tm_year); printf("month %d\n",(*x).tm_mon); printf("day %d of the month\n",(*x).tm_mday); printf("day %d of the year\n",(*x).tm_yday); printf("day %d of the week\n",(*x).tm_wday); printf("hour %d\n",(*x).tm_hour); printf("minute %d\n",(*x).tm_min); printf("second %d\n",(*x).tm_sec); return 0; }