/*
    2019年10月12日19:25:25
    说明:typedef在结构体中的应用
*/
#include<stdio.h>
typedef struct Student
{
    char name[9];
    int age;
}STU,*PSTU; //STU相当于struct Student,PSTU相当于struct Student *
int main(void)
{
    STU st; // 相当于struct Student st;
    PSTU pst = &st; //相当于struct Student *pst
    strcpy(pst->name,"蜡笔小新");
    pst->age = 5;
    printf("%s今年%d岁了\n",pst->name,pst->age);
    return 0;
}

相关文章:

  • 2021-12-26
  • 2022-01-31
  • 2022-12-23
  • 2022-01-01
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-10-27
  • 2021-10-04
  • 2022-12-23
相关资源
相似解决方案