Card getCard(UINT a)
{
try{
return deckOne.at(deckIndex.at(a));
}
catch(std::exception &e)
{
//fuuuuu
}
}
I have two vectors, one filled with Card objects, another with indices. The problem I am having is returning a value on error..?
I haven't done a lot of OOP yet. This method is inside a class, what's a good way to fix this error? Make a default card to return? How do I denote an error with the return value? I could put a reference to a bool or int in the paramter list which will tell me if an error has occured, so what should I return?

New Topic/Question
Reply




MultiQuote





|