Format specifiers for implementation-defined types like time_t
Usually you can use a cast to convert the operand to some type for which you know the right format. Your proposed solution: time_t t = time(NULL); printf(“%s”, t); clearly will not work, since time_t is a numeric type, not char*. We know, in general, that time_t is an arithmetic type. Something like this: printf(“%ld\n”, … Read more