C++????Щ?£?const?÷??????
???????????? ???????[ 2014/6/10 11:30:03 ] ????????C++ net
???????const????
?????? C/C++ ?????У?const?????????????η?????ν“???η?”??????????????б????????У??????????Щ“???”??“???”???????η???????????????κ??????? const ???η????????????????????????????ε???Щ??????????“???”???????????????У?????????????????????Щ???????????????????????????
?????????const???η????????????????????????????????????????????????????const??????б????“???????”????????????????????????????????Щ???????????б???????????????С??????????Щ?????????????????????????????????????const??????const?????????????????????????
???????const???????????????????????????const????????????????????????????????
????????const??????????Щ????
????????????????????const????????η????????????????Щ????????η?????????о????ЩC/C++?????const??????
????1??const????
????2??const???
????3??const????
????4??const??
????5?????const???????
????6?????const???????
????7??const???κ??????β??????
?????????????????????漸??????£?const???÷???
????????const?????
???????????????const???κ???????????????
????1???????????????????????????????м?飩
????2?????????????????
????3??C++???????const?????峣??????????C????????????define??
????1 const int var; // Error:???? ????"var"?????????趨??
????2 const int var1 = 42;
????3 var1 = 43; // Error??????????????????????
????????????е???к?????ж??д????????????????????????????
????????????????const?????????????±????????????????????????????(?????????????????)??
1 const int sz = 42;
2 int iAr[sz];
3 const int sz1 = size(); // size()?????????????????????
4 int iAr1[sz1];
5
6 int var = 42;
7 const int sz2 = var;
8 int iAr2[sz2]; // error??sz2??????????????
|
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11