g++ Fehlermeldung



  • Hallo zusammen,

    ich kompiliere

    #include <iostream>
    #include <string>
    
    using namespace std;
    
    class Cell
    {
    	private :	
    		Cell *next;
    
    	public :	
    		// Konstruktor
    		Cell() { next = NULL; }
    		Cell(Cell *p) { next = p; }
    
    		// Methode zum Setzen des Nachfolgers
    		void SetNext(Cell *p) { next = p; }
    
    		// Methode zum liefern des Nachfolgers
    		Cell *GetNext(void) { return next; }
    
    		// Ausgabe
    		virtual void display(void) = 0;
    
                    virtual ~Cell(){};
    }
    
    /*----------------------------------------------------------------------------*/
    
    class BaseEl : public Cell
    {
    
    	private :	
    		in[cpp]t prio;
    		string name;
    
    	public :
    		BaseEl(int p, char *name) 
    		{ prio = p; name = name; }
    
    		BaseEl(int pr, string n, Cell *p) : Cell(p)
    		{ prio = pr;  name = n; }
    
    		void SetPriority(int n) { prio = n; }
    		int GetPriority(void) { return prio; }
    		void SetName(string n) { name = n; }
    		string GetName(void) { return name; }
    
    		// Ausgabe
    		void display(void);		
    }
    
    /*----------------------------------------------------------------------------*/
    
    class ListEl : public BaseEl
    {
    
    	private : 
    		string anamnese;
    
    	public :
    
    		ListEl(string s, int p, char *name);
    		ListEl(string s, int p, char *name, Cell *n);		
    
    		// Anamnese bearbeiten
    		void SetAnam(void);
    
    		// Ausgabe
    		 void display(void);
    }
    
    /*----------------------------------------------------------------------------*/
    
    class PatientList
    {
    	private :
    		Cell *first;
    		int anz;
    
    	public :
    		Cell *GetFirst(void) { return first; }
    		void SetFirst(Cell *f) { first = f; }
          	     	int GetAnz(void) { return anz; }
    
    		// Erzeugt eine leere queue 
    		void Create(void) { first = NULL; anz = 0; } /* HIER IST ZEILE 96!!! */
    
    		// Atomare Operationen		
    		void Insert(int p, string n);
    		void Insert(int p, string n, string anam);
    		void DeleteMax();		
    
    		// Ausgabe
    		void display(void);
    
    		// Destruktor
    		~PatientList();
    }
    

    mit g++-4.0 und bekomme

    PrioQeue.h:96: Fehler: expected unqualified-id at end of input
    

    als Fehlermeldung.

    Was bezeichnet eine unqualified-id ?

    Danke für Eure Antworten!



  • Du hast das Semikolon am Ende der Klassendefinitionen vergessen:

    class Cell
    {
      ...
    };//<- ganz wichtig
    


  • Danke schön 🤡


Anmelden zum Antworten