2 errors !!!

This is a discussion on 2 errors !!! within the C++ Programming forums, part of the General Programming Boards category; im getting 2 errors in my program.....cant figure out WHAT they mean! can anyone plz plz plz help me correct ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    11

    2 errors !!!

    im getting 2 errors in my program.....cant figure out WHAT they mean! can anyone plz plz plz help me correct those errors bc i need o turn this in, in 2 days and im getting very nervous about it.
    THANK U.............
    Attached Files Attached Files

  2. #2
    Peace
    Join Date
    Aug 2001
    Posts
    1,510
    I dont really have time to take that code and compile it and see what happens... Sorry, i wish i did. If you posted your errors maybe i can tell you whats wrong?
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  3. #3
    Unregistered
    Guest
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Unknown Errors in simple program
    By neandrake in forum C++ Programming
    Replies: 16
    Last Post: 04-06-2004, 02:57 PM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21