zoukankan      html  css  js  c++  java
  • C语言结构体嵌套

    #include <stdio.h>
    
    int main()
    {
        /***************************************************
         *结构体嵌套:结构体里面包含结构体
         *
         *注意:被包含的结构体要先定义,结构体不能包含自己
         ****************************************************/
         struct Date
         {
             int year;
             int month;
             int day;
         };
         struct Student
         {
             int no;
             struct Date birthday;
         };
         struct Student student =
         {
                 1,
                 {1989, 2, 4}
         };
         printf("no = %d, birthday = %d年%d月%d日 
    ", student.no,
                   student.birthday.year, student.birthday.month, student.birthday.day);
         return 0;
    }
    no = 1, birthday = 1989年2月4日 
  • 相关阅读:
    02-cocoapods的安装和使用
    01-唐巧之cocoapods
    class0513(html)
    程序集
    c#面向对象
    html
    dom
    Javascript
    Jquery
    ado.net
  • 原文地址:https://www.cnblogs.com/heml/p/3530970.html
Copyright © 2011-2022 走看看