Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如您在此处看到的struct tm,天数为 1,而月数为 0。在Java等其他语言中也可以看到同样的情况。
struct tm
这样做的原因是什么?
我能找到的唯一目的是让这样的事情变得更容易:
const char *names[] = { "January", "February", ... }; names[date.tm_mon];