当前位置:网站首页>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;
}边栏推荐
猜你喜欢

Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data

typescript47-函数之间的类型兼容性

D-PHY

Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)

Kaggle 入门(Kaggle网站使用及项目复现)

3. 无重复字符的最长子串

高可用 两地三中心

深度学习入门之GRU

Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures

Js学习笔记(四)
随机推荐
Pr第四次培训笔记
设计模式——组合模式、享元模式(Integer缓存)(结构型模式)
typescript39-class类的可见修饰符
typescript43-类型兼容性说明
数据分析 第一篇
【Harmony OS】【ARK UI】ets use startAbility or startAbilityForResult to invoke Ability
flask 面试题 问题
在树莓派上搭建属于自己的网页(2)
-一尺之棰-
typescript46-函数之间的类型兼容性
1089 狼人杀-简单版 (20 分)
第四次培训
typescript41-class类的私有修饰符
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
反射注解基础
如何不耍流氓的做运维之-SHELL脚本
曲线特征----曲线弯曲程度的探究
C-PHY速率
业务表解析-余额系统
Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data