[Study Notes] [C Language] nesting of structure, Study Notes C language nesting

Source: Internet
Author: User

[Study Notes] [C Language] nesting of structure, Study Notes C language nesting

1 # include <stdio. h> 2 3 int main () 4 {5 struct Date 6 {7 int year; 8 int month; 9 int day; 10 }; 11 12 13 // type 14 struct Student15 {16 int no; // student ID 17 18 struct Date birthday; // birthday 19 20 struct Date ruxueDate; // admission date 21 22 // This is incorrect 23 // struct Student stu; 24}; 25 26 27 struct Student stu = {1, {2000, 9, 10 },{ 2012, 9, 10 }}; 28 29 printf ("year = % d, month = % d, day = % d \ n", stu. birthday. year, stu. birthday. month, stu. birthday. day); 30 31 32 33 34 35 return 0; 36}

 

Related Article

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.