当前位置:网站首页>Usage of const and assert
Usage of const and assert
2022-07-28 20:11:00 【Boring ~】
List of articles
1、const keyword
Use const Decorated variable , Variables will not be modified , Protect variables from being modified , Acts as the umbrella of variables . If you modify the value of the variable , The compiler will report an error .
const int* p = &a;
const Modification is *p, What we're protecting is *p, Make pointer variable p The object pointed to cannot be modified , But it will not limit p Value .
int* const p = &a;
const Modification is p, What we're protecting is p, Do not modify p Value , Can modify pointer variables p Object to point to .
2、assert keyword
assert If the result of the expression in is false , An error will be reported at compile time , Only the result is true , No mistake .
take assert Compared to a warning line , Do not cross the red line , Nothing , If you cross the red line , Will be punished .
边栏推荐
- English Translation Spanish - batch English Translation Spanish tools free of charge
- KPMG China: insights into information technology audit projects of securities fund management institutions
- In the second half of 2022, the system integration project management engineer certification starts on August 20
- Andorid system layout, values, drawable adaptation
- [in depth study of 4g/5g/6g topics -44]: urllc-15 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -9-low delay technology -3-non slot scheduling mini
- Design of air combat game based on qtgui image interface
- Circular linked list OJ question
- [network] cross area network communication learning classification and calculation of IPv4 address
- Find the memory occupied by the structure
- There is a 'single quotation mark' problem in the string when Oracle inserts data
猜你喜欢

私有化部署的即时通讯平台,为企业移动业务安全保驾护航

Deploy LNMP automatically with saltstack
![[C language] guessing numbers game [function]](/img/db/8ebdb02f137878224367503b730803.png)
[C language] guessing numbers game [function]

Item exception handling in SSM

KubeEdge发布云原生边缘计算威胁模型及安全防护技术白皮书

Idea properties file display \u solution of not displaying Chinese

The privatized instant messaging platform protects the security of enterprise mobile business

How many types of rain do you know?

ssm中项目异常处理

Can China make a breakthrough in the future development of the meta universe and occupy the highland?
随机推荐
MySQL command statement (personal summary)
Why is there no log output in the telnet login interface?
English translation Arabic - batch English translation Arabic tools free of charge
中国能否在元宇宙的未来发展中取得突破,占领高地?
2022年下半年系统集成项目管理工程师认证8月20日开班
C language function
河北:稳粮扩豆助力粮油生产提质增效
JVM(二十四) -- 性能监控与调优(五) -- 分析GC日志
通配符 SSL/TLS 证书
[in depth study of 4g/5g/6g topics -44]: urllc-15 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -9-low delay technology -3-non slot scheduling mini
What is the process of swing event processing?
Read how to deploy highly available k3s with external database
Digital filter design matlab
What is the variance?
[experience] some suggestions and experience on repairing electronic equipment
NEIL: Extracting Visual Knowledge from Web Data
3、 Are formal and actual parameters in a programming language variables?
CDGA|工业互联网行业怎么做好数据治理?
How many types of rain do you know?
利用STM32的HAL库驱动1.54寸 TFT屏(240*240 ST7789V)