Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


error in constructor

This topic is 5324 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing a simple class that does nothing but initialize its data members for now and it is giving me two errors in the constructor! It is so simple that I have no idea what to do. Here is my code:

typedef unsigned int u32;

class rpgchar
		//void attack(rpgchar *en);

		u32 ch,mh,cm,mm;
		u32 str,def,spd,dex,wil,mag;

#include "rpg.h"

{                   //errors(line 6)


Here are the errors: rpg.cpp:6: error: ISO C++ forbids defining types within return type rpg.cpp:6: error: return type specification for constructor invalid It seems like such simple code! Could someone please notice the obvious and tell me what I''m missing?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!