I tried to pass some enum data as argument for function but failed, is it impossible ?:rolleyes:
Printable View
I tried to pass some enum data as argument for function but failed, is it impossible ?:rolleyes:
Not at all
enum BOOLEAN { TRUE, FALSE};
int myfunction(BOOLEAN bValue);
And to use it..
BOOLEAN variable;
variable = TRUE;
myfunction(variable);
woh~~~ it works! :pQuote:
Originally posted by Dual-Catfish
Not at all
enum BOOLEAN { TRUE, FALSE};
int myfunction(BOOLEAN bValue);
And to use it..
BOOLEAN variable;
variable = TRUE;
myfunction(variable);
but it didnt in my constructor function. the code is right below, what's wrong ?:rolleyes:
PHP Code:enum GameKind{RPG,SLG,ACT,FTG,STG,SPG,RAC,ETC};
class Game
{
public:
Game(){cout << "I have no arguments~ *o*" << endl;};
Game(GameKind, string, string, int);
private:
GameKind kind;
string name;
string company;
int hot;
};
Game :: Game(GameKind k, string s1, string s2, int t)
{
cout << "I have some arguments~ ^o^" << endl;
}
>but it didnt in my constructor function
The declaration and definition do not match up.
-Prelude
sorry~ :p now it is fixed. but it refused to work yet. :rolleyes:Quote:
Originally posted by Prelude
>but it didnt in my constructor function
The declaration and definition do not match up.
-Prelude