Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Problem with SDL code...
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CptAJ




PostPosted: Thu May 10, 2007 4:23 pm   Post subject: Problem with SDL code...

First of all, greetings to everyone. This is my first time posting, hopefully of many to come. I've been reading the material around here for a while but never got around to posting before. Anyway, heres the problem:

The code: http://pastebin.ca/481492

I'm having a problem in line 128. Right as the sprite class constructor begins. The compiler spits this at me:
Return type specification for constructor invalid
New types may not be defined in a return type


Quote:

class sprite
{
private:
int x, y, xvel, yvel, phase; //Determines sprite position offsets and velocity

public:
sprite(); //Constructor
void handle_input();
void move ();
void show ();
}

sprite::sprite()
{
//Initialize offsets and velocity
x = 25;
y = 385;
xvel = 0;
yvel = 0;
phase = 0;
}

As you can see I'm not defining anything. I have no idea whats wrong here, the problem must be somewhere else in the code? I'm lost here.

Yes, there are other errors but I need to get past this one first and yes the code is not quite complete but still, what the hell is up with this one?

Hopefully you guys can give me a hand here...
Sponsor
Sponsor
Sponsor
sponsor
CptAJ




PostPosted: Thu May 10, 2007 4:33 pm   Post subject: RE:Problem with SDL code...

Nevermind, I found it. Forgot the semicolons after the classes.

It always happens >_>
wtd




PostPosted: Thu May 10, 2007 9:15 pm   Post subject: RE:Problem with SDL code...

Use constructor syntax for member initialization.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: