博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
结构体做函数参数的例子demo
阅读量:4212 次
发布时间:2019-05-26

本文共 728 字,大约阅读时间需要 2 分钟。

这段代码中,有一个注意的地方,scanf("%d",&(pArray[i].age)), 意思就是往这个地址中赋值。

#define  _CRT_SECURE_NO_WARNINGS #include 
#include
#include
typedef struct Teacher{ char name[64]; int age ; int id;}Teacher;void printTeacher(Teacher *array, int num){ int i = 0; for (i=0; i
array[j].age) { tmp = array[i]; //=号操作 赋值操作 array[i] = array[j]; array[j] = tmp; } } }}// 结构体数组 3 输入老师的年龄,排序void main22(){ int i = 0; Teacher Array[3]; //在stack 分配内存(临时区) int num = 3; for (i=0; i

 

附加一段小代码,更加具体演示scanf的用法

#include 
#include
#define high 2#define row 3#define col 4 int main(){ int i; printf("please enter the number of i\n"); scanf("%d",&i); printf("i : %d", i); }

 

转载地址:http://kqzmi.baihongyu.com/

你可能感兴趣的文章
数据仓库分层
查看>>
常见数据结构-TrieTree/线段树/TreeSet
查看>>
Hive数据倾斜
查看>>
TopK问题
查看>>
Hive调优
查看>>
HQL排查数据倾斜
查看>>
DAG以及任务调度
查看>>
LeetCode——DFS
查看>>
MapReduce Task数目划分
查看>>
ZooKeeper分布式锁
查看>>
3126 Prime Path
查看>>
app自动化测试---ADBInterface驱动安装失败问题:
查看>>
RobotFramework+Eclipse安装步骤
查看>>
测试的分类
查看>>
photoshop cc2019快捷键
查看>>
pycharm2019版本去掉下划线的方法
查看>>
SQL中EXISTS的用法
查看>>
10丨案例:在JMeter中如何设置参数化数据?
查看>>
11丨性能脚本:用案例和图示帮你理解HTTP协议
查看>>
12丨性能场景:做参数化之前,我们需要考虑什么?
查看>>