0

I am trying to build a dos mmorpg, and have already ran into a problem that might be very obvious, but I do not see it. Here is my code:

#include <iostream> 
#include <string.h> 
#include <ostream>
#define yes 1
using namespace std;     
class CharacterCreation;

class CharacterAttributes;

int main()
{

CharacterCreation CharCreateobject; 
CharCreateobject.CharacterRace(); 



} 

class CharacterCreation
{

public:
void CharacterRace()
{


    int Race;
    char YesOrNo;
    cout << "Are you sure you would like to make a character? " << endl;
    cin >> YesOrNo;

    cout << "Please enter the number of the race you would like to be " << endl;
    cout << "1. Human" << endl << "2. Elf" << endl << "3. Giant" << endl << "4. Griffon" << endl << "5. Dwarf" << endl << "6. Orc" << endl;
    cin >> Race;
    CharacterAttributes CharAttributObject;
    switch (Race)
    {

    case 1:
        cout << "You are a Human." << endl;

        CharAttributObject.CharHuman();
        break;
    case 2:
        cout << "You are an Elf." << endl;

    case 3:
        cout << "You are a Giant." << endl;

    case 4:
        cout << "You are a Griffon." << endl;

    case 5:
        cout << "You are a Dwarf." << endl;

    case 6:
        cout << "You are an Orc." << endl;

    }



}



};

class CharacterAttributes
{

public:
void CharHuman()
{

    cout << "TEST!" << endl;

}

}; 

I really don't know what I have done, but I suspect that the errors are wrong. If you could help, please do tell me as it would be appreciated!:) Once again, here is my error:

Error C2079: 'CharCreateobject' uses undefined class 'CharacterCreation'
error C2228: left of '.CharacterRace' must have class/struct/union  

I also have two of each of these errors. It looks like this with all errors:

Error C2079: 'CharCreateobject' uses undefined class 'CharacterCreation'     

error C2228: left of '.CharacterRace' must have class/struct/union  

Error   3   error C2079: 'CharAttributObject' uses undefined class 'CharacterAttributes'    

Error   4   error C2228: left of '.CharHuman' must have class/struct/union  
melpomene
  • 84,125
  • 8
  • 85
  • 148

0 Answers0