I tried to pass some enum data as argument for function but failed, is it impossible ?
I tried to pass some enum data as argument for function but failed, is it impossible ?
Never end on learning~
Not at all
enum BOOLEAN { TRUE, FALSE};
int myfunction(BOOLEAN bValue);
And to use it..
BOOLEAN variable;
variable = TRUE;
myfunction(variable);
woh~~~ it works!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 ?
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;
}
Last edited by black; 06-27-2002 at 11:48 PM.
Never end on learning~
>but it didnt in my constructor function
The declaration and definition do not match up.
-Prelude
My best code is written with the delete key.
sorry~ now it is fixed. but it refused to work yet.Originally posted by Prelude
>but it didnt in my constructor function
The declaration and definition do not match up.
-Prelude
Never end on learning~