Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why can tm_sec in the tm structure range from 0 to 61, suggesting that there can be 62 seconds in a minute?

0
10 Posted

Why can tm_sec in the tm structure range from 0 to 61, suggesting that there can be 62 seconds in a minute?

0
10

That’s actually a buglet in the Standard. There can be 61 seconds in a minute during a leap second. It’s possible for there to be two leap seconds in a year, but it turns out that it’s guaranteed that they’ll never both occur in the same day (let alone the same minute). comp.lang.c FAQ list ยท Question 20.34 Q: Here’s a good puzzle: how do you write a program which produces its own source code as output? A: It is actually quite difficult to write a self-reproducing program that is truly portable, due particularly to quoting and character set difficulties. Here is a classic example (which ought to be presented on one line, although it will fix itself the first time it’s run): char*s=”char*s=%c%s%c;main(){printf(s,34,s,34);}”; main(){printf(s,34,s,34);} (This program has a few deficiencies, among other things neglecting to #include , and assuming that the double-quote character ” has the value 34, as it does in ASCII.) Here is an improved version, posted by James Hu: #define q(k)

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123