Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <string>
#include <iostream>
using namespace std;
class health
{
private:
int player, monster;
string level;
public:
void setPlayer(int _player)
{
player = _player;
}
int getPlayer()
{
return player;
}
void setMonster(int _monster)
{
monster = _monster;
}
int getMonster()
{
return monster;
}
string getLevel(string _level)
{
return level;
}
};
#include "health.h"
#include <string>
#include <iostream>
using namespace std;
int main()
{
health playerhealthobj;
playerhealthobj.setPlayer(100);
cout << playerhealthobj.getPlayer() << endl;
{
health monsterhealthobj;
monsterhealthobj.setMonster(90);
cout << monsterhealthobj.getMonster()<< endl;
}
}