Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Player {
- private:
- double x, y;
- string name;
- int health_points;
- public:
- Player(double _x, double _y, string _name, int _health_points) {
- x = _x;
- y = _y;
- name = _name;
- health_points = _health_points;
- }
- void print_player() {
- cout << x << " " << y << " " << name << " " << health_points << endl;
- }
- };
- int main()
- {
- Player david(1.0, 6.7, "david", 100);
- david.print_player();
- }
Advertisement
Add Comment
Please, Sign In to add comment