我的第九个代码
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
struct Book
{
char name[20];
short int price;
};
int main()
{
struct Book b1 = { "C语言程序设计",45 };
printf("书名:%s\n", b1.name);
printf("价格:%d\n", b1.price);
b1.price= 55;
printf("改价之后:%d\n", b1.price);
return 0;
}
//学习结构体(创建一本书)