当前位置:网站首页>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;
}
边栏推荐
- SQL FOREIGN KEY
- 奥比中光 astra: Could not open “2bc5/[email protected]/6“: Failed to set USB interface
- [5g NR] RRC connection release
- Some problems about pytorch extension
- Boot 事务使用
- Solve the problem of base64encoder error
- Fiddler realizes mobile packet capturing - getting started
- Boot 连接 Impala数据库
- GraphX 图计算实践之模式匹配抽取特定子图
- Idea public method extraction shortcut key
猜你喜欢

The outline dimension function application of small motherboard

Boot 事务使用

Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network

如何實現十億級離線 CSV 導入 Nebula Graph

Teach you how to build virtual machines locally and deploy microservices

【5G NR】RRC连接释放

Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys

Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit

《大学“电路分析基础”课程实验合集.实验七》丨正弦稳态电路的研究

Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin
随机推荐
Experiment collection of University Course "Fundamentals of circuit analysis". Experiment 5 - Research on equivalent circuit of linear active two terminal network
Strings and arrays
Armv8-a programming guide MMU (4)
lseek 出错
处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
Wavedec2 in MATLAB, talk about the wavedec2 function [easy to understand]
/Bin/ld: cannot find -lpam
Various entanglements between qvariant and Jason -- QT
手机app通达信添加自定义公式(分时T+0)为例子讲解
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
Introduction to database system Chapter 1 short answer questions - how was the final exam?
/bin/ld: 找不到 -lssl
Experiment collection of University "Fundamentals of circuit analysis". Experiment 7 - Research on sinusoidal steady-state circuit
Fastjson list to jsonarray and jsonarray to list "suggested collections"
Boot 事务使用
Best practices for building multi architecture images
Add an empty column to spark dataframe - add an empty column to spark dataframe
奥比中光 astra: Could not open “2bc5/[email protected]/6“: Failed to set USB interface
Demo of converting point cloud coordinates to world coordinates
Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!