Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Back to GDK problems

Author
Message
Malboro Jones
14
Years of Service
User Offline
Joined: 10th Dec 2009
Location: Wales - UK
Posted: 10th Nov 2010 01:01
Heyyy, haven't used DarkGDK or C++ in a while and I seem to have forgotten everything

Just a few problems, I made a class (Player) in a .h file, included it and tried building:

PlayerClass.h:


Game.cpp:





What am I doing wrong?

Don't make war, make tea.
Greg_C
14
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 10th Nov 2010 01:05
When you make a class you have to put ; at the end like so:

Malboro Jones
14
Years of Service
User Offline
Joined: 10th Dec 2009
Location: Wales - UK
Posted: 10th Nov 2010 01:17
Ah right nice one Need to read up on my C++ again methinks!

Don't make war, make tea.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 10th Nov 2010 08:02
Not only that. This will be an error too:


Either you create an instance of the class as a local variable like this:
or dynamically allocate memory for it but then you need a pointer:
and in this case you need to delete it later.
Malboro Jones
14
Years of Service
User Offline
Joined: 10th Dec 2009
Location: Wales - UK
Posted: 17th Nov 2010 17:34
Ye I noticed that I've been using C# for the last few months! I'll get the hang of it again soon.

Thanks.

Don't make war, make tea.

Login to post a reply

Server time is: 2024-11-19 16:39:27
Your offset time is: 2024-11-19 16:39:27