当前位置:网站首页>7.18(7)
7.18(7)
2022-08-03 05:11:00 【tt142】
今天跟着老师一起写了一些函数,课上有四个练习题,都是之前写过的循环之类的,今天用自定义函数写出来
课上还补充了结构体的知识,之前自学的时候没有学过
下面是一个自己写并且能跑的简单结构体
结构体就是用来描述一个复杂的研究对象的一些信息
#include <stdio.h>
struct MAN
{
char name[10];
char sex[10];
int age;
char id[20];
};
int main()
{
struct MAN s = { "dan","female",3,"12345678" };
printf("%s %s %d %s", s.name, s.sex, s.age, s.id);
return 0;
}
struct MAN
{
char name[10];
char sex[10];
int age;
char id[20];
};
void print(struct MAN* ps)
{
printf("%s %s %d %s", ps->name, ps->sex, ps->age, ps->id);
}
int main()
{
struct MAN s = { "dan","female",3,"12345678" };
print(&s);
return 0;
}
边栏推荐
猜你喜欢
Alienware上线首个数字时装AR试穿体验
在树莓派上搭建属于自己的网页(1)
Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)
轨迹(形状)相似性判断与度量方法
【特征选取】计算数据点曲率
内部类、static关键字、final
js implements a bind function
1230: 蜂巢
typescript42-readonly修饰符
Build your own web page on the Raspberry Pi (2)
随机推荐
User password verification
-钞票兑换-
Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures
业务表解析-余额系统
MySql数据库
1089 狼人杀-简单版 (20 分)
vim命令
【Harmony OS】【ARK UI】ets use startAbility or startAbilityForResult to invoke Ability
D-PHY
用pulp库解决运输问题【详细】
求因子数量
Tag stack - stack monotonically preparatory knowledge - lt. 739. The daily temperature
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
快速上手 Mockito 单元测试框架
Shell conditional statement judgment
Installation of Apache DolphinScheduler version 2.0.5 distributed cluster
minio下载文件乱码或者是一条横线
typescript46-函数之间的类型兼容性
Ali cloud object storage oss private barrels to generate links
C# async and multithreading