I'm doing a little project for school and have to create an enumeration with types of monsters and then a function that takes a value and displays the monster type as a string. Here's my bit of code:
enum MonsterType
{
GHOST,
DRAGON,
GHOUL,
SHRIEKER,
GRIFFIN,
};
string getTypeName()
{
int ID;
cout << "Input Monster ID" << endl;
cin >> ID;
return MonsterType(ID);
}
The errors I'm getting are the following:
no suitable constructor exists to convert from "MonsterType" to "std::basic_string<char, std::char_traits<char>, std::allocator<char>>"
and
'return': cannot convert from 'MonsterType' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
I'm sure there's a little thing I'm missing and not aware of and I'd really appreciate it if you could help me out.
Thank you