const运用

· · 个人记录

\text{const} 是个函数可以将一个变量锁死,不能改变

```c++ #include <bits/stdc++.h> using namespace std; const n=10; int main() { n=20; cout<<n; return 0; } ``` 输出的是 $10$ 而并非 $20$。