当前位置:网站首页>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;
}
边栏推荐
- The sea of stars hidden behind the nebula graph
- beforeEach
- HMS core machine learning service helps zaful users to shop conveniently
- The task cannot be submitted after the installation of flick is completed
- Fiddler实现手机抓包——入门
- fastjson List转JSONArray以及JSONArray转List「建议收藏」
- [2. Basics of Delphi grammar] 3 Object Pascal constants and variables
- [5g NR] RRC connection release
- 全方位解读服务网格(Service Mesh)的背景和概念
- 将点云坐标转换成世界坐标的demo
猜你喜欢

隐藏在 Nebula Graph 背后的星辰大海

《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究

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

How to import a billion level offline CSV into Nepal graph

如何實現十億級離線 CSV 導入 Nebula Graph

《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量

Aike AI frontier promotion (7.2)

Aiko ai Frontier promotion (7.2)

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

Armv8-a programming guide MMU (4)
随机推荐
Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC
《大学“电路分析基础”课程实验合集.实验四》丨线性电路特性的研究
数仓中的维度表与事实表
matlab中wavedec2,说说wavedec2函数[通俗易懂]
构建多架构镜像的最佳实践
愛可可AI前沿推介(7.2)
PyObject 转 char* (string)
SQL修改语句
/bin/ld: 找不到 -lssl
XPT2046 四线电阻式触摸屏
Wise target detection 23 - pytoch builds SSD target detection platform
ssh/scp 使不提示 All activities are monitored and reported.
Idea public method extraction shortcut key
Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
Flink real-time data warehouse (7): Flink realizes the full pull module to extract data in MySQL
/Bin/ld: cannot find -lssl
基于 Nebula Graph 构建百亿关系知识图谱实践
Traversal before, during and after binary tree
Strings and arrays
/bin/ld: 找不到 -lcrypto