当前位置:网站首页>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 .
边栏推荐
- Why can't my MySQL container start
- Socket TCP for network communication (I)
- If you can't learn, you have to learn. Jetpack compose writes an im app (II)
- lambda与匿名内部类的区别
- Adult adult adult
- OpenGL draws colored triangles
- 阿里大于发送短信(用户微服务--消息微服务)
- Pragma pack syntax and usage
- Slf4j log facade
- elastic_ L04_ introduction. md
猜你喜欢
Sword finger offer06 Print linked list from end to end
If you can't learn, you have to learn. Jetpack compose writes an im app (I)
Use bloc to build a page instance of shutter
阿里大于发送短信(用户微服务--消息微服务)
Shutter: overview of shutter architecture (excerpt)
记录自己vulnhub闯关记录
2.8 overview of ViewModel knowledge
剑指Offer07. 重建二叉树
剑指Offer03. 数组中重复的数字【简单】
ES6 standard
随机推荐
剑指Offer07. 重建二叉树
Summary of development issues
(construction notes) learning experience of MIT reading
[combinatorics] permutation and combination (example of permutation and combination)
Shell: basic learning
Flutter Widget : Flow
Atomic atomic operation
QT OpenGL rotate, pan, zoom
023 ([template] minimum spanning tree) (minimum spanning tree)
Develop plug-ins for idea
OpenGL shader use
1-2 project technology selection and structure
init. RC service failed to start
Shutter: overview of shutter architecture (excerpt)
Flutter Widget : KeyedSubtree
Redis
01_ Using the concurrent tool class library, is thread safety safe
(construction notes) grasp learning experience
MySQL time zone solution
Official website of Unicode query