当前位置:网站首页>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;
}
边栏推荐
- beforeEach
- Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
- idea jar包冲突排查
- QVariant与Json的各种纠葛——Qt
- Armv8-a programming guide MMU (4)
- Song of cactus - throwing stones to ask the way (3)
- Nebula Graph & 数仓血缘关系数据的存储与读写
- The outline dimension function application of small motherboard
- Target detection - make your own deep learning target detection data set with labelimg
- 死锁的条件及解决方法
猜你喜欢
Boot transaction usage
How to import a billion level offline CSV into Nepal graph
mysql 计算经纬度范围内的数据
Maui学习之路(三)--Winui3深入探讨
Construction and business practice of Zhongke brain knowledge map platform
Ant group's large-scale map computing system tugraph passed the national evaluation
Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin
处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
Mobile web development learning notes - Layout
随机推荐
Boot 中bean配置覆盖
可视化技术在 Nebula Graph 中的应用
Another graduation season
《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
SQL modification statement
微信v3native支付设置的结束时间处理办法
理想之光不灭
纪念成为首个 DAYU200 三方 demo 贡献者
又是一年毕业季
Leetcode --- longest public prefix
Leetcode -- number of palindromes
/Bin/ld: cannot find -llz4
Introduction to dynamic planning I, BFS of queue (70.121.279.200)
原神2.6服务端下载以及搭建安装教程
Summary of multithreading and thread synchronization knowledge
Register as a harmonios developer and install deveco studio 3.0 beta2 for harmonios
Solve the problem of base64encoder error
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
/Bin/ld: cannot find -lgssapi_ krb5
Tree binary search tree