C++??????????????????
???????????? ???????[ 2015/3/24 14:16:29 ] ????????C++ ?????? ???? static
????1?????????????
????????????Ч???????? ??????????????н??и???????????Ч????????????????????б??н??С?
????class CA
????{
????public:
????int data;
????……
????public:
????CA();
????……
????};
????CA::CA():data(0)//……#1……??????б???
????{
????//data = 0;//……#1……??????
????};
????2??static ?????????
????static?????????????У?????????????????????????????????????????????????????????????????????е??????????????????
????class CA
????{
????public:
????static int sum;
????……
????public:
????CA();
????……
????};
????int CA::sum=0;//……#2……??????г????
????3??const ??????????
????const???????????????????????????????????????????????г??????????????????????????б??н??С?
????class CA
????{
????public:
????const int max;
????……
????public:
????CA();
????……
????};
????CA::CA():max(100)
????{
????……
????}
????4??Reference ???????????
???????????????const?????????????????????????г????????????????б??н??С???????????Reference?????
????class CA
????{
????public:
????int init;
????int& counter;
????……
????public:
????CA();
????……
????};
????CA::CA():counter(init)
????{
????……
????}
??????
???·???
??????????????????
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