Code:
class dice
{
int N;
char A;
char F;
char X;
void value_num (int N);
void value_frt (char F);
void value_ani (char A);
void EX (char X);
public:
dice(int, char, char, char);
void operation (int,char,int);
};/*!added!*/
dice::dice(int set_num, char set_frt, char set_ani,char ex)
{
N = set_num;
F = set_frt;
A = set_ani;
X = ex;
}
void /*!added!*/ dice::operation( int set, char value,int act)
{
/*!deleted - no input declared!*/ // cout<<"Roll the dice?"<<input<<"\n";
switch(act)
{
case 1 : set_num(N),value_num(N); break;
case 2 : set_frt(F),value_frt(F); break;
case 3 : set_ani(A),value_ani(A); break;
case 4 : ex(X),value_ex(X);break;
default: /*! was deafult!*/: cout<<"Thank you for palying!"<<act<<"\n";
break;
}
}
I fixed a bit - see the /*! comments
But you really ought to start paying attention to your spelling.
Like all these member functions are either missing or spelled wrong
Code:
cpr-test.cpp:44: warning: implicit declaration of function `int set_num(...)'
cpr-test.cpp:45: warning: implicit declaration of function `int set_frt(...)'
cpr-test.cpp:46: warning: implicit declaration of function `int set_ani(...)'
cpr-test.cpp:47: warning: implicit declaration of function `int ex(...)'
cpr-test.cpp:47: warning: implicit declaration of function `int value_ex(...)'
cpr-test.cpp:48: parse error before `:'
cpr-test.cpp: At top level:
cpr-test.cpp:55: no `void dice::num(int)' member function declared in class `dice'
cpr-test.cpp: In method `void dice::value_num(int)':
cpr-test.cpp:58: parse error before `}'
cpr-test.cpp: At top level:
cpr-test.cpp:63: no `void dice::frt(char)' member function declared in class `dice'
cpr-test.cpp:71: no `void dice::ani(char)' member function declared in class `dice'
cpr-test.cpp:79: no `void dice::ex(char)' member function declared in class `dice'
My advice is you try and compile when you've added ONE function, not when you've written the whole program.