I am making a text based adventure game called Magick.
In this game I have a class labeled damageSpell
it looks like this
class damageSpell {
public:
int damage;
SubClasses type;
int manaCost;
std::string spellDescription;
};
I used this class as the type for a vector like so
std::vector<damageSpell> damageSpells
Later on, I attempted to add an element into my damageSpells
vector, by using the insert
function on vector.
damageSpell fireball;
user.damageSpells.insert(user.damageSpells.begin(), 0, fireball);
Then attempted to print it out
std::cout << user.damageSpells[0];
Upon doing this I received this error
magick1.cpp:252:15: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream}’ and ‘damageSpell’)
I am new to C++ and have no idea what this means or how I should go about fixing it, any and all help will be appreciated.