Problem with classes.

hello, i'm following a ebook i bought from game institute it says the following

http://puu.sh/3Dchg.png

this is what i've wrote onto my script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
int main ()
{
	// properties -> functions.

	class Wizard
	{
	public:
		//Functions 
		void fight();
		void talk();
		void castSpell();

		//Variables
		std::string mName;
		int mHitPoints;
		int mMagicPoints;
		int mArmor;

	};

	void Wizard::fight()
	{
		cout << "Fighting." << endl;
	}
}


but i get these errors http://puu.sh/3DckQ.png

to be honest i'm only new to this so i dont know what the error means fully what i can grasp though is that, the member function ( method ) is being changed since i implimented it inside wizard but i dont see how that happens, i might be completely wrong sorry.


any help or anything will be greatly appreciated :)

I'm sorry i forgot which forum i clicked on to post this i thought it was beginners. what do i do ?
Define the class, methods and functions outside `main()'
And inside main, something like:

1
2
3
4
5
6
7
8
9
int main()
{
    Wizard Gandalf;
    Gandalf.fight();

    return 0;
}

Topic archived. No new replies allowed.