C语言开发示例:38. 结构体
2024-07-10 11:49:15 2025-02-01 20:08:27 李腾 23 次阅读 0 次点赞
struct.c
#include <stdio.h>
typedef struct
{
int age;
int height;
char name[20];
char father[20];
char mother[20];
} Horse;
int main()
{
Horse dobbin = {
24, 17, "Dobbin", "Trigger", "Flossie"};
Horse trigger = {
.age = 30, .height = 15, .name = "Trigger", .mother = "Smith", .father = "Wesson"};
dobbin.age = 12;
}
本文由人工编写,AI优化,请仔细甄别,转载请注明转自www.hylab.cn,原文地址:C语言开发示例:38. 结构体