当前位置:网站首页>day4
day4
2022-07-02 12:40:00 【51CTO】
用宏简化了之前的函数^-^
#include <stdio.h>
#include <stdlib.h>
#define MAX(X,Y) (X>Y?X:Y)
int main(int argc, char *argv[]) {
int a;
int b;
printf("输入想比较的两个数字:>\n");
scanf("%d\n%d",&a,&b);
int max = MAX(a,b);
printf("较大数值:%d",max);
return 0;
}
接触指针的第一天:(
int main()
{
int a = 10;
int* b = &a;
printf("%p\n",b);
*b = 2*a;
printf("%d",a);
return 0;
}
引用了外部函数(对于自己写的小东西未免有些多此一举,哈哈)
int b;
extern test();
int main(int argc, char *argv[])
{
int i = 0;
while (i<5)
{
b = test();
printf("%d\n",b);
i++;
}
return 0;
}
外部函数:
int test()
{
static int a = 1;
a++;
return a;
}
边栏推荐
- Traversal before, during and after binary tree
- Aiko ai Frontier promotion (7.2)
- [2. Basics of Delphi grammar] 3 Object Pascal constants and variables
- Postgressql stream replication active / standby switchover primary database no read / write downtime scenario
- Dimension table and fact table in data warehouse
- 【小白聊云】中小企业容器化改造建议
- Soul torture, what is AQS???
- 解决BASE64Encoder报错的问题
- Data Lake (11): Iceberg table data organization and query
- 多数据源配置代码
猜你喜欢
Figure database | Nepal graph v3.1.0 performance report
Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points
又是一年毕业季
Aiko ai Frontier promotion (7.2)
微信v3native支付设置的结束时间处理办法
Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
HMS core machine learning service helps zaful users to shop conveniently
智联招聘的基于 Nebula Graph 的推荐实践分享
win10系统升级一段时间后,内存占用过高
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
随机推荐
数组和链表的区别浅析
Some problems about pytorch extension
Armv8-a programming guide MMU (4)
Tree binary search tree
使用FFmpeg命令行进行UDP、RTP推流(H264、TS),ffplay接收
仙人掌之歌——投石问路(2)
目标检测—利用labelimg制作自己的深度学习目标检测数据集
Data Lake (11): Iceberg table data organization and query
Experiment collection of University "Fundamentals of circuit analysis". Experiment 4 - Research on linear circuit characteristics
Jsp+mysql006 community management system
Pyinstaller打包exe附带图片的方法
lseek 出错
Why does the system convert the temp environment variable to a short file name?
Song of cactus - throwing stones to ask the way (2)
QVariant与Json的各种纠葛——Qt
PHP static members
Song of cactus - throwing stones to ask the way (3)
将点云坐标转换成世界坐标的demo
Target detection - make your own deep learning target detection data set with labelimg
爱可可AI前沿推介(7.2)