当前位置:网站首页>Macro definition usage and typedef and Const
Macro definition usage and typedef and Const
2022-06-22 11:56:00 【Carefree young heart】
typedef Can be used to define some of their own classes
const Definition fixed value cannot be modified
typedef int zhengxing;
zhengxing u = 10;
printf("%i \r\n", u);//10
const int i = 10;
i = 5;// Report errors
first #if #endif If if If the latter condition is true, compile the code between them Otherwise, do not compile
#if 0
char* ptr_size;//32 It's a plane : 4 byte 64 It's a plane : 8 byte
printf("%d \n",sizeof(ptr_size));
#endif // 0
the second :#define
#define num(a,b) a+b
int a = num(1, 3);
printf("%i", a);
Third use #define Define a function or class
// This ## Is the function of the connection string
// This can be used to FunName This parameter is linked to other content
#define num1(FunName,a,b) \ int FunName##_Hello(int a,int b) \ {
\ return a+b;\ }
num1(III, x, y);
int main()
{
int e=III_Hello(1, 2);
printf("%i \r\n", e);
}
// Macro defines a class
#define num2(FunName,astring) \ class CCC_##FunName \ {
\ public: \ CCC_##FunName() \ :a(#astring) \ {
} \ char a; \ };
边栏推荐
- APM set pitch four rotor control mode
- [2022 summer] [leetcode] 31 Next spread
- 国外LEAD需要干劲、兴趣、钻研、勤奋、缺一不可
- Call center terminology
- 牛客挑战赛53E题解 & 带花树学习笔记
- Exchange the nodes in the linked list in pairs [the principle of one-way linked list without chain]
- Idr Display function obtains the summary statistical information of Poisson regression Poisson model (initial event density ratio IDR value, adjusted event density ratio IDR value and its confidence i
- 《梦华录》成吸金王:广告主投500万排不上队,腾讯视频赢麻了?
- Solution to 54e of Niuke challenge
- IO之ByteArrayStream案例
猜你喜欢

Utilisation de la classification knn de Matlab (avec code source), réalisation de la classification des pixels (auto - réglage de l'échelle de l'ensemble de formation), précision de l'essai d'impressi

俞敏洪称未来可能开电商学院;马斯克儿子申请断绝父子关系;饿了么回应大量用户收到免单信息;B站上线付费视频...

Electron adding SQLite database

牛客挑战赛53C

1.11 haas506 2.0开发教程-driver-RTC(仅支持2.2以上版本)

From prototype chain to inheritance, illustrate the context and recommend collection

electron添加SQLite數據庫

Authenticated cookies, sessions, JWT

NFT交易平台数字藏品系统开发技术
![[安洵杯 2019]iamthinking](/img/56/ffdcdeb8246d9ae7fb1eb72b45b614.png)
[安洵杯 2019]iamthinking
随机推荐
CF736 D2
CF736 D2
鉴权之cookie、session、JWT
牛客挑战赛55D题解
R language uses user-defined functions to write step activation functions for deep learning and visualize step activation functions
Call center CTI system
Add custom fields to the time synchronization message based on uavcan protocol in Px4 code learning
马尔可夫链(Markov Chain),隐马尔可夫模型
Explanation of 94F question in Niuke practice match
奋斗吧,程序员——第四十一章 今日种种,似水无痕;明夕何夕,君已陌路
Solution to 57c of Niuke challenge
Sometimes hard work is not what you are willing to do
Promise upgraded async, await is coming, which is more fragrant with try+catch
promise升级版async,await来袭,搭配try+catch更香哦
The use of cellstr function in MATLAB
Puzzle (019) plane forward problem
Foreign lead needs energy, interest, research, diligence and is indispensable
haas506 2.0开发教程-高级组件库-modem.info(仅支持2.2以上版本)
[Software Engineering] Introduction & process and life cycle modeling
奋斗吧,程序员——第四十三章 十步杀一人,千里不留行