当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

Dimension table and fact table in data warehouse

Xpt2046 four wire resistive touch screen

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

Idea jar package conflict troubleshooting

Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points

爱可可AI前沿推介(7.2)

又是一年毕业季

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

Boot transaction usage

Why does the system convert the temp environment variable to a short file name?
随机推荐
Make p12 certificate [easy to understand]
/Bin/ld: cannot find -lssl
多数据源配置代码
Fiddler realizes mobile packet capturing - getting started
Idea jar package conflict troubleshooting
Teach you how to build virtual machines locally and deploy microservices
全是精华的模电专题复习资料:基本放大电路知识点
【5G NR】RRC连接释放
解决BASE64Encoder报错的问题
matlab中wavedec2,说说wavedec2函数[通俗易懂]
Use ffmpeg command line to push UDP and RTP streams (H264 and TS), and ffplay receives
6092. Replace elements in the array
智联招聘的基于 Nebula Graph 的推荐实践分享
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Locate: cannot execute stat() `/var/lib/mlocate/mlocate Db ': there is no such file or directory
Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
PostgresSQL 流复制 主备切换 主库无读写宕机场景
How to import a billion level offline CSV into Nepal graph
[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)
Introduction to Dynamic Planning II (5.647.62)