当前位置:网站首页>day4
day4
2022-07-02 16:08:00 【51CTO】
Simplify the previous functions with macros ^-^
#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(" Enter the two numbers you want to compare :>\n");
scanf("%d\n%d",&a,&b);
int max = MAX(a,b);
printf(" Larger value :%d",max);
return 0;
}
The first day of touching the pointer :(
int main()
{
int a = 10;
int* b = &a;
printf("%p\n",b);
*b = 2*a;
printf("%d",a);
return 0;
}
External functions are referenced ( It's unnecessary to write something by yourself , ha-ha )
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;
}
External function :
int test()
{
static int a = 1;
a++;
return a;
}
边栏推荐
- Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
- Armv8-a programming guide MMU (4)
- Use ffmpeg command line to push UDP and RTP streams (H264 and TS), and ffplay receives
- Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
- /Bin/ld: cannot find -lgssapi_ krb5
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- The outline dimension function application of small motherboard
- 死锁的条件及解决方法
- GraphX 图计算实践之模式匹配抽取特定子图
- Multi data source configuration code
猜你喜欢

JS learning notes - data types

Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin

win10系统升级一段时间后,内存占用过高

End time processing method of wechat v3native payment settings

Mobile web development learning notes - Layout

Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC

去除router-link中的下划线

Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!

idea 公共方法抽取快捷键

Figure database | Nepal graph v3.1.0 performance report
随机推荐
多数据源配置代码
蚂蚁集团大规模图计算系统TuGraph通过国家级评测
Boot 连接 Impala数据库
How to use percona tool to add fields to MySQL table after interruption
Figure database | Nepal graph v3.1.0 performance report
Conditions and solutions of deadlock
[idea] recommend an idea translation plug-in: translation "suggestions collection"
Usage of group by
dried food! Understand the structural vulnerability of graph convolution networks
[5g NR] RRC connection release
Invalid bound statement (not found)解决方法总结
构建多架构镜像的最佳实践
Register as a harmonios developer and install deveco studio 3.0 beta2 for harmonios
Tree binary search tree
数据库系统概论第一章简答题-期末考得怎么样?
JS learning notes - first acquaintance
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
Solve * * warning * *: your ApplicationContext is unlikely to start due to a @componentscan of the defau
Idea jar package conflict troubleshooting
JS learning notes - data types