cpp/basics/const #27
Replies: 3 comments 2 replies
-
const int b = func(); // b 的值为 10,不能被修改 |
Beta Was this translation helpful? Give feedback.
2 replies
-
想不让编译器做优化,让 10 变成 20给 a 再定义一个 volatile 关键字。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
局部 const 变量在栈上分配地址。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
cpp/basics/const
编程指北: 计算机系统学习指南, 操作系统, 计算机网络, C++, Java, 算法, 数据结构
https://csguide.cn/cpp/basics/const.html
Beta Was this translation helpful? Give feedback.
All reactions