当前位置:网站首页>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;
}边栏推荐
猜你喜欢
随机推荐
Create a tree structure
-飞机大战-
建造者模式(Builder Pattern)
web安全-sql注入漏洞
odps的临时查询能在写sql的时候就给结果一个命名不?
-完全数-
Alienware上线首个数字时装AR试穿体验
高效率科研神器——小软件、大能量
D-PHY
lintcode2330 · 计算x秒后的时间
1094 谷歌的招聘 (20 分)
Benchmark 第一篇 了解Benchmark
Makefile介绍
MySql数据库
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
Install PostgreSQL on Windows
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data
三角形个数
Odps temporary query can write SQL, turned out to a named?









