A
Alden Pierre
Hello,
I'm having a hard time trying to figure why my code will not compile.
When I try to compile the code, I get the non-aggregate type error. Any
ideas on what I'm doing wrong?
---------------------------------------------------------------------
File: main.cpp
---------------------------------------------------------------------
#include "roster.h"
int main( void )
{
Roster myRoster();
for( int i =0; i < 3; i++ ){
myRoster.addItem();
}
myRoster.print();
return 0;
}
-------------------------------------------------------------------------
File Roster.h
-------------------------------------------------------------------------
#ifndef _ROSTER_H_
#define _ROSTER_H_
#include "person.h"
#include "student.h"
#include "faculty.h"
#include "admin.h"
#include <iostream>
using std::boolalpha;
struct Node
{
Person *p;
Node *next;
};
class Roster
{
public:
Roster();
~Roster();
bool addItem( void );
bool isEmpty( void );
void print( void );
private:
int Selection();
void rosterAdd( int );
Node *head;
Node *tail;
};
#endif
Regards,
Alden
I'm having a hard time trying to figure why my code will not compile.
When I try to compile the code, I get the non-aggregate type error. Any
ideas on what I'm doing wrong?
---------------------------------------------------------------------
File: main.cpp
---------------------------------------------------------------------
#include "roster.h"
int main( void )
{
Roster myRoster();
for( int i =0; i < 3; i++ ){
myRoster.addItem();
}
myRoster.print();
return 0;
}
-------------------------------------------------------------------------
File Roster.h
-------------------------------------------------------------------------
#ifndef _ROSTER_H_
#define _ROSTER_H_
#include "person.h"
#include "student.h"
#include "faculty.h"
#include "admin.h"
#include <iostream>
using std::boolalpha;
struct Node
{
Person *p;
Node *next;
};
class Roster
{
public:
Roster();
~Roster();
bool addItem( void );
bool isEmpty( void );
void print( void );
private:
int Selection();
void rosterAdd( int );
Node *head;
Node *tail;
};
#endif
Regards,
Alden