当前位置:网站首页>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;
}
边栏推荐
- The principle of attention mechanism and its application in seq2seq (bahadanau attention)
- Raki's notes on reading paper: code and named entity recognition in stackoverflow
- How should programmers learn mathematics
- Serpentine matrix
- Leetcode 222 number of nodes of complete binary tree
- 机器学习 --- 神经网络
- [phantom engine UE] only six steps are needed to realize the deployment of ue5 pixel stream and avoid detours! (the principles of 4.26 and 4.27 are similar)
- Neural networks and deep learning Chapter 4: feedforward neural networks reading questions
- User behavior collection platform
- C26451: arithmetic overflow: use the operator * on a 4-byte value, and then convert the result to an 8-byte value. To avoid overflow, cast the value to wide type before calling the operator * (io.2)
猜你喜欢
直播預告 | 容器服務 ACK 彈性預測最佳實踐
2022-2028 global and Chinese video coding and transcoding Market Research Report
[illusory engine UE] method to realize close-range rotation of operating objects under fuzzy background and pit recording
[uniapp] system hot update implementation ideas
File upload bypass summary (upload labs 21 customs clearance tutorial attached)
Live broadcast preview | container service ack elasticity prediction best practice
【虚幻引擎UE】运行和启动的区别,常见问题分析
2022-2028 global and Chinese equipment as a Service Market Research Report
【虚幻引擎UE】实现UE5像素流部署仅需六步操作少走弯路!(4.26和4.27原理类似)
Matplotlib draws three-dimensional scatter and surface graphs
随机推荐
3 minutes learn to create Google account and email detailed tutorial!
NetSetMan pro (IP fast switching tool) official Chinese version v5.1.0 | computer IP switching software download
2022-2028 global and Chinese equipment as a Service Market Research Report
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
Sequelize. JS and hasmany - belongsto vs hasmany in serialize js
机器学习 --- 神经网络
Introduction to RT thread kernel (5) -- memory management
Label exchange experiment
Scheduling system of kubernetes cluster
File upload bypass summary (upload labs 21 customs clearance tutorial attached)
【UNIAPP】系统热更新实现思路
Neural networks and deep learning Chapter 2: machine learning overview reading questions
Study notes 7
10 programming habits that web developers should develop
Hypothesis testing -- learning notes of Chapter 8 of probability theory and mathematical statistics
Here comes the Lantern Festival red envelope!
Neural networks and deep learning Chapter 4: feedforward neural networks reading questions
PHP reads the INI file and writes the modified content
QT Bluetooth: a class for searching Bluetooth devices -- qbluetooth devicediscoveryagent
American 5g open ran suffered another major setback, and its attempt to counter China's 5g technology has failed