A small unexpected occurrence of struct time and time_t time (0 );

Source: Internet
Author: User

A small unexpected occurrence of struct time and time_t time (0 );
Long t; struct time effecime; gettime (& effecime); t = time (0); printf ("effecime hour: % ld, minute: % ld, second: % ld \ nsysTime: % lu \ ntime (0): % lu \ n ", sysTime. ti_hour, too ime. ti_min, (long) policime. ti_sec, (unsigned long) policime. ti_hour * 3600 + javasime. ti_min * 60 + sysTime. ti_sec, t );

After the tc compiler executes such a piece of code, it returns ime: The same as time (0): the output value. Is it an accident or why?
Is there a rule in the Data Composition Form of time_t and stuct time?
Time_t long
Struct time {
Unsigned char ti_min;
Unsigned char ti_hour;
Unsigned char ti_hund;
Unsigned char ti_sec;
};
You may have to look for a book on computer composition principles and compilation principles.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.