当前位置:网站首页>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 .
边栏推荐
- DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程
- 347. Top k high frequency elements
- Symlink(): solution to protocol error in PHP artisan storage:link on win10
- Official website of Unicode query
- idea将web项目打包成war包并部署到服务器上运行
- Apache Mina开发手册
- SLF4J 日志门面
- Capturing and sorting out external Fiddler -- Conversation bar and filter [2]
- (construction notes) learn the specific technology of how to design reusable software entities from three levels: class, API and framework
- Dart: about grpc (I)
猜你喜欢
PHP export word method (phpword)
Sword finger offer04 Search in two-dimensional array [medium]
[official MySQL document] deadlock
(construction notes) ADT and OOP
Pki/ca and digital certificate
Self made pop-up input box, input text, and click to complete the event.
Summary of development issues
idea将web项目打包成war包并部署到服务器上运行
If you can't learn, you have to learn. Jetpack compose writes an im app (I)
[ManageEngine] the role of IP address scanning
随机推荐
How to deploy web pages to Alibaba cloud
Pragma pack syntax and usage
wpa_ cli
[download attached] password acquisition tool lazagne installation and use
Dart: about grpc (I)
Symlink(): solution to protocol error in PHP artisan storage:link on win10
MySQL time zone solution
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
SystemVerilog -- OOP -- copy of object
JVM memory model
2020-11_ Technical experience set
Use of atomicinteger
(構造筆記)從類、API、框架三個層面學習如何設計可複用軟件實體的具體技術
为什么我的mysql容器启动不了呢
网上炒股开户安不安全?谁给回答一下
在网上炒股开户可以吗?资金安全吗?
Flutter 退出登录二次确认怎么做才更优雅?
OpenGL draws colored triangles
flinksql是可以直接客户端建表读mysql或是kafka数据,但是怎么让它自动流转计算起来呢?
4000字超详解指针