??????????????C++??????????
???????????? ???????[ 2014/7/2 11:24:38 ] ????????Net ???????
????1. C++????????????
????????C++???????????????????????弼?????????????????C++??????????????????????????paradigms????C++????????????????????????????????????????????????????????????????????(class)??C++?????????????????????????????????????е?????????????Э??????????????????硣?????????????????????????????????????????????????????????????????
????C++??????????????????????????
??????????????(??????????)
????????????(?????????)
???????????
??????????????
???????????????????????У???????????麯?????????????
?????????????C++??????????г????????????????????沼???????????????????????????
????2. ???????????
??????????????????class point??????????????????????????????????????????????????????????????????????????????????£?
class point
{
public:
point(int x?? int y)
{
this->x = x;
this->y = y;
ins_cnt++;
}
~point()
{
ins_cnt--;
}
static int get_instances()
{
return ins_cnt;
}
point & move(int addx?? int addy)
{
this->x += addx;
this->y += addy;
return *this;
}
private:
int x?? y;
static int ins_cnt;
};
int point::ins_cnt = 0;
int main()
{
point x(3?? 4);
x.move(10?? 10);
int p_ins_cnt = point::get_instances();
return 0;
}
|
??????
???·???
??????????????????
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