当前位置:网站首页>Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
2022-07-03 12:33:00 【Android little white star】
This is a macro definition with parameters , Usually, the macro parameters in the macro content text are replaced with text .
Let's use this to write an example for calculation .
#define SUM(x) 3*x*x+1
int main()
{
int i=5;
int j=8;
printf("%d\n",SUM(i+j));
}
The answer from the computer is 64.
My wrong idea at the beginning is :3*(5+8)*(5+8)+1.
But the difference between the calculated value and the actual value .
The right thinking is :SUM Don't put parentheses Take it with you , Only the formula Take it to .3*5+8*5+8+1.
The calculated answer is exactly the same as the actual answer .
边栏推荐
- Socket TCP for network communication (I)
- 公纵号发送提示信息(用户微服务--消息微服务)
- Dart: about grpc (I)
- (database authorization - redis) summary of unauthorized access vulnerabilities in redis
- 剑指Offer04. 二维数组中的查找【中等】
- (構造筆記)從類、API、框架三個層面學習如何設計可複用軟件實體的具體技術
- Use of atomicinteger
- 023 ([template] minimum spanning tree) (minimum spanning tree)
- Itext7 uses iexternalsignature container for signature and signature verification
- Pki/ca and digital certificate
猜你喜欢
随机推荐
Eureka自我保护
New features of ES6
DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程
20. Valid brackets
【ManageEngine】IP地址扫描的作用
为什么我的mysql容器启动不了呢
QT OpenGL rotate, pan, zoom
剑指Offer03. 数组中重复的数字【简单】
023(【模板】最小生成树)(最小生成树)
[combinatorics] permutation and combination (example of permutation and combination)
雲計算未來 — 雲原生
idea将web项目打包成war包并部署到服务器上运行
剑指Offer09. 用两个栈实现队列
regular expression
剑指Offer04. 二维数组中的查找【中等】
[combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
Self made pop-up input box, input text, and click to complete the event.
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
Sword finger offer07 Rebuild binary tree
JVM memory model
![[ManageEngine] the role of IP address scanning](/img/dc/df353da0e93e4d936c39a39493b508.png)








