首页 > 其他 > 详细

typedef的用法02

时间:2021-09-07 18:42:07      阅读:23      评论:0      收藏:0      [点我收藏+]

#include<stdio.h>
#include<string.h>

 

typedef struct Books {
char title[10];
char bookname[10];
char author[20];
int bookID;
}Book;


int main(int argc, const char *argv[])
{
Book book1;  // 替换struct Books book1

strcpy(book1.title, "Cyuyan");
strcpy(book1.author, "zhagnsna");
strcpy(book1.bookname, "C语言速成");
book1.bookID = 234;
printf("%s\n", book1.title);
printf("%s \n %s\n%s\n %d\n", book1.title, book1.author, book1.bookname, book1.bookID);
return 0;
}

typedef的用法02

原文:https://www.cnblogs.com/wang-xiao-shuai/p/15237427.html

(0)
(0)
   
举报
评论 一句话评论(0
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!