I have a class LineObject which is being inherited by a class LineItemNode, as requsted by my instructor. All the child class is supposed to do is add the functionality of being placed in a custom linked list. But for some reason the class methods aren't accessible by the child class. I don't understand why, what am I doing wrong?
LineObject.h
#ifndef LineObject_H
#define LineObject_H
#include <string>
using namespace std;
class LineObject
{
public:
LineObject();
LineObject(LineObject & lo); // Copy Constructor
LineObject(string i_makeModel, string i_driverName, int i_bhp, int i_class, double i_carValue, bool i_nos, bool i_slk);
/* Set functions to set data individually */
void set_MakeMdlDriver(string i_makeModel, string i_driverName);
void set_BHPClass(int i_bhp, int i_class);
void set_CarValue(double i_carValue);
void set_NosSlk(bool i_nos, bool i_slk);
void set_All(string i_makeModel, string i_driverName, int i_bhp, int i_class, double i_carValue, bool i_nos, bool i_slk);
/* Displays object data to screen */
void DisplayObjectData();
/* Get functions to get data from class */
int get_bhp() {return bhp;}
int get_raceClass() {return raceClass;}
double get_carValue() {return carValue;}
string get_makeModel() {return makeModel;}
string get_driverName() {return driverName;}
bool get_NOS() {return nos_Installed;}
bool get_SLK() {return slk_Installed;}
/*Overloaded Operators*/
bool operator > (LineObject elem);
bool operator > (LineObject *elem);
bool operator < (LineObject elem);
bool operator < (LineObject *elem);
bool operator == (LineObject elem);
protected:
string makeModel;
string driverName;
int bhp;
int raceClass;
double carValue;
bool nos_Installed; //Nitros systems are included in many performance cars.
bool slk_Installed; //Slicks are a type of tire used on racing vehicles to increase performance.
};
#endif
LineItemNode.h
#ifndef LINODE_H
#define LINODE_H
#include "LineObject.h"
using namespace std;
class LineItemNode : public LineObject
{
private:
LineItemNode *next;
LineItemNode *prev;
public:
LineItemNode();
};
#endif
Let me know if you need anything else. Does anyone know if there is an option in VS2005 that 'hides' parent class methods for some reason?

New Topic/Question
Reply




MultiQuote




|