当前位置:网站首页>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;
}
边栏推荐
- Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
- Multi data source configuration code
- (5) Flink's table API and SQL update mode and Kafka connector case
- [Xiaobai chat cloud] suggestions on container transformation of small and medium-sized enterprises
- PHP static members
- beforeEach
- Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
- Xpt2046 four wire resistive touch screen
- /bin/ld: 找不到 -llz4
- /Bin/ld: cannot find -lpam
猜你喜欢
使用 percona 工具给 MySQL 表加字段中断后该如何操作
[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)
Boot transaction usage
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!
Pattern matching extraction of specific subgraphs in graphx graph Computing Practice
基于 Nebula Graph 构建百亿关系知识图谱实践
Construction and business practice of Zhongke brain knowledge map platform
Figure database | Nepal graph v3.1.0 performance report
又是一年毕业季
Review materials for the special topic of analog electronics with all essence: basic amplification circuit knowledge points
随机推荐
Song of cactus - throwing stones to ask the way (3)
[idea] recommend an idea translation plug-in: translation "suggestions collection"
Boot transaction usage
【idea】推荐一个idea翻译插件:Translation「建议收藏」
解决BASE64Encoder报错的问题
Demo of converting point cloud coordinates to world coordinates
图数据库|Nebula Graph v3.1.0 性能报告
Best practices for building multi architecture images
中科大脑知识图谱平台建设及业务实践
In memory of becoming the first dayu200 tripartite demo contributor
Another graduation season
如何實現十億級離線 CSV 導入 Nebula Graph
Song of cactus - throwing stones to ask the way (2)
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
Some problems about pytorch extension
Flink real-time data warehouse (IX): incremental synchronization of data in MySQL
QVariant与Json的各种纠葛——Qt
华为云服务器安装mysqlb for mysqld.service failed because the control process exited with error code.See “sys
智联招聘的基于 Nebula Graph 的推荐实践分享
仙人掌之歌——投石问路(2)