当前位置:网站首页>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;
}
边栏推荐
- Register as a harmonios developer and install deveco studio 3.0 beta2 for harmonios
- Construction and business practice of Zhongke brain knowledge map platform
- Bean configuration override in boot
- 2020.4.12 byte written test questions B DP D monotone stack
- Nebula Graph & 数仓血缘关系数据的存储与读写
- Wise target detection 23 - pytoch builds SSD target detection platform
- Aike AI frontier promotion (7.2)
- Practice of constructing ten billion relationship knowledge map based on Nebula graph
- 去除router-link中的下划线
- 【5G NR】RRC连接释放
猜你喜欢

Vscode设置标签页多行显示

Aiko ai Frontier promotion (7.2)

手机app通达信添加自定义公式(分时T+0)为例子讲解

Introduction to Dynamic Planning II (5.647.62)

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

Construction and business practice of Zhongke brain knowledge map platform

Nebula Graph & 数仓血缘关系数据的存储与读写

《大学“电路分析基础”课程实验合集.实验五》丨线性有源二端网络等效电路的研究

Memory alignment of structure

Mobile web development learning notes - Layout
随机推荐
/Bin/ld: cannot find -lgssapi_ krb5
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
Introduction to dynamic planning I, BFS of queue (70.121.279.200)
Experiment collection of University "Fundamentals of circuit analysis". Experiment 6 - observation and measurement of typical signals
Aiko ai Frontier promotion (7.2)
Maui learning road (III) -- in depth discussion of winui3
Introduction to database system Chapter 1 short answer questions - how was the final exam?
AWS云主机扩容
仙人掌之歌——投石问路(3)
处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
源码look me
Make p12 certificate [easy to understand]
《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
Flink real-time data warehouse (7): Flink realizes the full pull module to extract data in MySQL
Tree binary search tree
Analysis of the difference between array and linked list
可视化技术在 Nebula Graph 中的应用
SQL modification statement
[Xiaobai chat cloud] suggestions on container transformation of small and medium-sized enterprises
Idea jar package conflict troubleshooting