C++ const?÷??????????
???????????? ???????[ 2014/3/11 14:27:57 ] ????????c++ ???? ????
????effective c++ ????03????:Use const whenever possible ?????const ?????????c++???????????澡???????????const ???÷?????ɡ?????????????c++ primer????????????c++ primer ????棨????棩?????
????????? const?????(p49)
????????const???????????
?????????????????????????????????const??????????????????????????????????????????????У?????????????????
??????????const?????extern ????????????????з???const???? ??extern const int bufsize = 1??
??????????const?????p51??
????const?????????const?????????????????const???e???const???????????const???e?????const????const????????????????????????????????????
??????????const???????????е?????p59??
???????const???????ó???????????????????????????????С????????????????С?
?????????const?????p110??
????1.???const????????
???????const??????????????const?????const double *ptr????ptr???????const?????????????????????????????ptr??????????????????ptr??????????????
???????????void *????const??????????????????const void*
??????????const??????????????const?????????????????????????????????
????2.const???
????const???????????????????????????????????????
????3.???const?????const???
????const double pi = 3??
????const double *const pi_ptr = &pi??
????????????pt_ptr???????????????????????????
????4.const?βΣ?p200??
????????????????????????const?βΣ???????ú???????const????????????const????Ρ?
????????????βζ???????????const??????????????const?????????????const??????????в?????????ε?? ??????
????5.???const?????????βκ?????const?????????βΣ?p200??
???????????β?????const????????(const int *)?????????????const????????(const int *)?????????????????? const????????(int *)?????????????β?
???????????β??????const????????int *) ?????????????const????????int *)?????????????????????const ?????????????????
???????壩 const???????βΣ?p205??
??????y???????????????βζ????const???á???????const?????β???????????????????βμ???????const?????????????????????????????????????????
???????????????const?β?(p235)
???????????????????β??????const??????????const??????????????????????βζ????const????????????????
????Record lookup(Account&);
????Record lookup( const Account &); //new function
?????????????????????const???????????????
????f(int *)
????f(int * const) // redeclaration
?????????const???????
????const?????????????????ú????????
????const ???????const?????????????????????????const????????????????????????÷?const?????????????????
??????
???·???
??????????????????
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