zoukankan      html  css  js  c++  java
  • [C语言]关于struct和typedef struct

    在C中定义一个结构体类型要用typedef:

    ***************************************************************************
        typedef struct Student
        {
        int a;
        }Stu;

    *****************************************************************************
        于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明)
        这里的Stu实际上就是struct Student的别名。Stu==struct Student

    *************************************************************************************

        typedef struct
        {
        int a;
        }Stu;

        另外这里也可以不写Student(于是也不能struct Student stu1;了,必须是Stu stu1;)

    **************************************************************************

  • 相关阅读:
    文件操作
    内置函数
    lambda表达式
    函数基础
    基础数据类型-dict
    基础数据类型-tuple
    基础数据类型-list
    基础数据类型-set
    Python开发【第三篇】基本数据类型
    Python开发【第二篇】运算符
  • 原文地址:https://www.cnblogs.com/Tea1024/p/5844511.html
Copyright © 2011-2022 走看看