Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Expected Declaration Before '}' Token | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
beneficii

Lakitu
Level: 36

Posts: 147/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-19-05 06:02 PM Link | Quote
Here is a class:

class basic {
public:
basic() {;}
~basic() {;}
int load(int curwold);
int save();
int *getworld(void) {return &world;}
int *getpalettenum(void) {return &palettenum;}
int *getmap_tiles(void) {return map_tiles;}
int *getanimrate(void) {return animationrate;}
int *get1stmusic(void) {return &firstmusic;}
int *get2ndmusic(void) {return &duringmusic;}
int *getsize(void) {return &size;}
private:
int palettenum;
int map_tiles[0x240];
int size;
int world;
int animationrate[4];
int firstmusic;
int duringmusic;
};

For the line,
int *getmap_tiles(void) {return map_tiles;}

My compiler (gcc) for some reason keeps giving me the error of:

"expected declaration before '}' token"

Basically, this is stumping me. As you can see, I declared map_tiles already, as an array under the private level. Basically, all that is meant with the function int *basic::getmap_tiles(void) is to return the pointer to map_tiles. When I comment out getmap_tiles(void) (and the other functions that access it), there is no error. int *basic::getanimrate(void), which is very similar, does not return an error at all.

EDIT: Never mind. It was something unrelated, but for some reason instead of telling me the real problem, it simply kept fooling with me with that.


(edited by beneficii on 06-19-05 09:36 AM)
(edited by beneficii on 06-19-05 12:15 PM)
(edited by beneficii on 06-19-05 12:22 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 5086/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 06-20-05 12:39 AM Link | Quote
Don't you love when they do that? I had errors regarding a missing semicolon, which wasn't missing, because a bracket was in the wrong place in a completely different file. And don't even think about leaving out the semicolon at the end of function prototype declarations...
beneficii

Lakitu
Level: 36

Posts: 148/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-20-05 05:18 AM Link | Quote
Originally posted by HyperHacker
Don't you love when they do that? I had errors regarding a missing semicolon, which wasn't missing, because a bracket was in the wrong place in a completely different file. And don't even think about leaving out the semicolon at the end of function prototype declarations...


LOL, yeah. Needless to say, I have had this sort of problem before.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - Expected Declaration Before '}' Token | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.