---------------------------------------------------------
Expand|Select|Wrap|Line Numbers
- player::player()
- {
- points = 1000;
- name = "ABC";
- kills = 0;
- }
- player::player(int a)
- {
- y = a;
- }
- int player::getPoints()
- {
- return points;
- }
- int player::operator+=(player &tmp)
- {
- points += tmp.y;
- return points;
- }
and in my source:
---------------------------------------------------------
Expand|Select|Wrap|Line Numbers
- a.getPoints += 1000;
- cout << a.getName() << " has killed: " << a.getKills() << " and have: " << a.getPoints() << " points" << endl;