resolved one error and one segfault in xpp02
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#ifndef WARLOCK_HPP
|
||||
# define WARLOCK_HPP
|
||||
#define WARLOCK_HPP
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
class Warlock {
|
||||
class Warlock
|
||||
{
|
||||
private:
|
||||
Warlock();
|
||||
Warlock(Warlock const & other);
|
||||
@@ -14,34 +15,36 @@ class Warlock {
|
||||
std::string title;
|
||||
|
||||
public:
|
||||
Warlock(std::string const & name, std::string const & title)
|
||||
Warlock(std::string const name, std::string const title)
|
||||
{
|
||||
this->name = name;
|
||||
this->title = title;
|
||||
std::cout << this->name << ": This looks like another boring day.\n";
|
||||
};
|
||||
}
|
||||
~Warlock()
|
||||
{
|
||||
std::cout << this->name << ": My job here is done!\n";
|
||||
};
|
||||
}
|
||||
|
||||
std::string const & getName() const
|
||||
{
|
||||
return (this->name);
|
||||
};
|
||||
return this->name;
|
||||
}
|
||||
std::string const & getTitle() const
|
||||
{
|
||||
return (this->title);
|
||||
};
|
||||
return this->title;
|
||||
}
|
||||
|
||||
void setTitle(std::string const & title)
|
||||
{
|
||||
this->title = title;
|
||||
};
|
||||
}
|
||||
|
||||
void introduce() const
|
||||
{
|
||||
std::cout << this->name << ": I am " << this->name << ", " << this->title << "!\n";
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user