I have this big problem with using enumerators in a class function
Code:
class Automat
{
public:
void print();
int AddCoins(enum Coins, int MoreCoins);
private:
typedef enum {One=1, Two, Three} Coins;
int MoreCoins;
--snip--
Automat::AddCoins(Automat::Coins, int MoreCoins)
{
if (Coins == ONE)
CoinStack += MoreCoins;
}
etc...
I get this error from Eclipse
Code:
error: 'enum Automat::Coins' is private
I have tried moving it around to public: and outside the class entirely.
I also get an error on the function:
Code:
error: 'Automat::AddCoins(int, int)'
error: expected identifier before ',' token
error: C++ forbids declaration of 'AddCoins' with no type
can someone point me in the right direction, as I am a bit lost on the syntax, as to why it doesn't accept my enums as parameters to a function