I'm having trouble defining a default constructor and destructor outside of the class. When i put TicketManager(); and ~TicketManager(); inside of the class as prototypes, it gives me a void _thisfunctioncall error. When I don't put them, it compiles fine but does not give any output when the object is created. here is my code, they are three seperate files.
#ifndef TICKETMANAGER_H
#define TICKETMANAGER_H
usingnamespace std;
class TicketManager
{
struct SeatStructures //Create a structure that contains the price of a seat and the seat's availability.
{
double price;
char avail;
};
public:
private:
conststaticint rows = 0, //Counter variables for the loops.
cols = 0;
conststaticint S_ROWS = 15, //Holds the values for the number of rows and columns.
S_COLS = 30;
SeatStructures SeatChart[S_ROWS][S_COLS];
};
#endif
#ifndef TICKETMANAGER_H
#define TICKETMANAGER_H
usingnamespace std;
class TicketManager
{
struct SeatStructures //Create a structure that contains the price of a seat and the seat's availability.
{
double price;
char avail;
};
public:
TicketManager();~TicketManager();private:
conststaticint rows = 0, //Counter variables for the loops.
cols = 0;
conststaticint S_ROWS = 15, //Holds the values for the number of rows and columns.
S_COLS = 30;
SeatStructures SeatChart[S_ROWS][S_COLS];
};
#endif
project.obj : error LNK2019: unresolved external symbol "public _thiscall TicketManager::~TicketManager(void)" (!!1TicketManager@@AE@XZ) referenced in function _main
project.obj : error LNK2019: unresolved external symbol "public: _thiscall TicketManager::TicketManager(void)" (??0TicketManager@@QA@XZ) referenced in function _main
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.. see... I was only trying to compile the main program. I guess I should've read that section on making seperate files. I'm so happy I could cry. Thanks guys... I'm so happy. Sad thing is, I probably would've never figured that one out.