Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
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 |
| ||
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 |
| ||
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 |
| ||
Originally posted by HyperHacker 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 | | | |