Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 6th, 2005, 9:42 PM   #1
Chrono310
Newbie
 
Join Date: Apr 2005
Posts: 2
Rep Power: 0 Chrono310 is on a distinguished road
Question [Solved] Parse error?

#ifndef listB
#define listB
struct nodeB
{
  char name[21],
       position;
  double batAve;
  int atBats,
      hits;
  nodeB* next;
};

class listB
{
  public:
    listB();
    ~listB();
    bool add(char* nameTok, char* posTok, char* atBatsTok,
             char* hitsTok);
    void print();
    bool print(string name);
  private:
    nodeB* head;
};
#endif

For some reason I'm getting these errors from the compiler:
16 listB.h parse error before `)' token
14 listB.h an anonymous union cannot have function members
24 listB.h abstract declarator `<anonymous struct>' used as declaration
24 listB.h namespace-scope anonymous aggregates must be static

I'm hoping it's just something dumb that I'm missing...

Last edited by Chrono310; Apr 7th, 2005 at 3:43 PM. Reason: Solved
Chrono310 is offline   Reply With Quote
Old Apr 7th, 2005, 3:10 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
can you post your listb.cpp file as header files you cant compile seperatly :/
Berto is offline   Reply With Quote
Old Apr 7th, 2005, 3:41 PM   #3
Chrono310
Newbie
 
Join Date: Apr 2005
Posts: 2
Rep Power: 0 Chrono310 is on a distinguished road
Solved

Actually, I figued out the problem. The #declare listB needs to be changed so it isn't the same thing as the class name. I just made it LIST_B, and it doesn't give me that error anymore. Thanks anyway though.
Chrono310 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC