// In your terminal write each command
g++ main.cpp Warlock.cpp
./a.out > result.txt
diff result.txt displayExample.txt // If you see a difference there is a problem
- What is an abstract class Abstract class allows to create a generic class like ASpell or ATarget where other class will be derived
- Forget the const when you have a function that takes string for example
ASpell::ASpell(std::string const Sname, std::string const Seffects) // don't forget the const
{
this->name = Sname;
this->effects = Seffects;
}
- Forget to return (*this) operator= for the coplien's
ATarget &ATarget::operator=(ATarget const &other)
{
this->type = other.type;
return (*this);
}
- I forgot #pragma once in my hpp files Allow to include your file only once during compilation. It generated a lot of mistakes