当前位置:网站首页>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;
}
边栏推荐
- Lseek error
- /bin/ld: 找不到 -llz4
- Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
- Group by的用法
- Pyobject to char* (string)
- /Bin/ld: cannot find -lxslt
- 《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
- Target detection - make your own deep learning target detection data set with labelimg
- /bin/ld: 找不到 -lxslt
- Jsp+mysql006 community management system
猜你喜欢

注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS

《大学“电路分析基础”课程实验合集.实验五》丨线性有源二端网络等效电路的研究

Why does the system convert the temp environment variable to a short file name?

Aike AI frontier promotion (7.2)

爱可可AI前沿推介(7.2)

华为云服务器安装mysqlb for mysqld.service failed because the control process exited with error code.See “sys

Soul torture, what is AQS???

Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit

Introduction to Dynamic Planning II (5.647.62)

可视化技术在 Nebula Graph 中的应用
随机推荐
《大学“电路分析基础”课程实验合集.实验五》丨线性有源二端网络等效电路的研究
Another graduation season
使用FFmpeg命令行进行UDP、RTP推流(H264、TS),ffplay接收
Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
Construction and business practice of Zhongke brain knowledge map platform
Boot connection to impala database
Invalid bound statement (not found)解决方法总结
华为云服务器安装mysqlb for mysqld.service failed because the control process exited with error code.See “sys
/Bin/ld: cannot find -llz4
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
mysql 计算经纬度范围内的数据
全是精华的模电专题复习资料:基本放大电路知识点
解决BASE64Encoder报错的问题
idea jar包冲突排查
构建多架构镜像的最佳实践
目标检测—利用labelimg制作自己的深度学习目标检测数据集
《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究
可视化技术在 Nebula Graph 中的应用
手机app通达信添加自定义公式(分时T+0)为例子讲解
C # get PLC information (kepserver) II