当前位置:网站首页>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;
}
边栏推荐
- After the win10 system is upgraded for a period of time, the memory occupation is too high
- SQL modification statement
- [idea] recommend an idea translation plug-in: translation "suggestions collection"
- Boot transaction usage
- 构建多架构镜像的最佳实践
- 动态规划入门一,队列的bfs(70.121.279.200)
- How to import a billion level offline CSV into Nepal graph
- How to use percona tool to add fields to MySQL table after interruption
- Wavedec2 in MATLAB, talk about the wavedec2 function [easy to understand]
- Moveit 避障路径规划 demo
猜你喜欢

如何实现十亿级离线 CSV 导入 Nebula Graph

Application of visualization technology in Nebula graph

PHP static members

Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys

Xpt2046 four wire resistive touch screen

idea jar包冲突排查

Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network

《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究

Dimension table and fact table in data warehouse

After the win10 system is upgraded for a period of time, the memory occupation is too high
随机推荐
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
Locate: cannot execute stat() `/var/lib/mlocate/mlocate Db ': there is no such file or directory
[solution] educational codeforces round 82
/bin/ld: 找不到 -lpam
【idea】推荐一个idea翻译插件:Translation「建议收藏」
Introduction to dynamic planning I, BFS of queue (70.121.279.200)
Target detection - make your own deep learning target detection data set with labelimg
/Bin/ld: cannot find -lcrypto
QVariant与Json的各种纠葛——Qt
win10系统升级一段时间后,内存占用过高
Data Lake (11): Iceberg table data organization and query
Ant group's large-scale map computing system tugraph passed the national evaluation
愛可可AI前沿推介(7.2)
beforeEach
locate: 无法执行 stat () `/var/lib/mlocate/mlocate.db‘: 没有那个文件或目录
Wavedec2 in MATLAB, talk about the wavedec2 function [easy to understand]
数仓中的维度表与事实表
Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
Usage of group by
PyObject 转 char* (string)