#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
struct com
{
int num; /*编号*/
char* name; /*名字*/
int count; /*数量*/
double price; /*价格*/
}*p;
int main()
{
p = (struct com*)malloc(sizeof(struct com));
p->num = 1001;
p->name = "苹果";
p->count = 20;
p->price = 5.20;
printf("编号为%d\n名字为%s\n数量为%d\n价格为%f\n", p->num, p->name, p->count, p->price);
return 0;
}
商品信息的动态存放
于 2023-02-22 21:40:50 首次发布