当前位置:网站首页>Inline built-in function
Inline built-in function
2022-07-05 04:34:00 【On the bald Road】
How to write it : It can be declared and defined in full inline You can also write only when declaring .
purpose : Before calling this function inline The information of informs the compiling system , The compilation system will handle function calls as built-in functions . If you call many times or have requirements for call efficiency, you can declare to ask the built-in function ;
Be careful !: The built-in function declaration only suggests the system , Not instructions .
Only simple functions with small scale and frequent calls are applicable .
Example :
#include<iostream>
using namespace std;
inline int max(int, int, int);
int main() {
int a = max(5, 6, 9);
cout << a;
return 0;
}
int max(int a, int b, int c) {
int maxword = a;
if (a < b) {
maxword = b;
}
if (maxword < c) {
maxword = c;
}
return maxword;
}
边栏推荐
- SPI read / write flash principle + complete code
- 函数(易错)
- Chapter 6 text processing tools for shell programming (awk)
- 防护电路中的元器件
- Network layer - forwarding (IP, ARP, DCHP, ICMP, network layer addressing, network address translation)
- [untitled]
- A survey of automatic speech recognition (ASR) research
- Fuel consumption calculator
- Power management bus (pmbus)
- Introduction to RT thread kernel (5) -- memory management
猜你喜欢
CSDN正文自动生成目录
What are the building energy-saving software
[moteur illusoire UE] il ne faut que six étapes pour réaliser le déploiement du flux de pixels ue5 et éviter les détours! (4.26 et 4.27 principes similaires)
2022-2028 global and Chinese video coding and transcoding Market Research Report
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
Web开发人员应该养成的10个编程习惯
Reading and visualization of DICOM, MHD and raw files in medical imaging
【UNIAPP】系统热更新实现思路
Uncover the seven quirky brain circuits necessary for technology leaders
线上故障突突突?如何紧急诊断、排查与恢复
随机推荐
mxnet导入报各种libcudart*.so、 libcuda*.so找不到
2022-2028 global and Chinese FPGA prototype system Market Research Report
揭秘技术 Leader 必备的七大清奇脑回路
可观测|时序数据降采样在Prometheus实践复盘
Practice | mobile end practice
【虚幻引擎UE】打包报错出现!FindPin错误的解决办法
【虚幻引擎UE】运行和启动的区别,常见问题分析
蛇形矩阵
CSDN正文自动生成目录
After the deployment of web resources, the navigator cannot obtain the solution of mediadevices instance (navigator.mediadevices is undefined)
QT Bluetooth: a class for searching Bluetooth devices -- qbluetooth devicediscoveryagent
CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1
Leetcode hot topic Hot 100 day 33: "subset"
FFmepg使用指南
MySQL: view with subquery in the from clause limit
level17
这是一个不确定的时代
Here comes the Lantern Festival red envelope!
概率论与数理统计考试重点复习路线
【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录