Class Member Object Inheritance
-
Dear sirs: I am learning VC++ and am having trouble compiling my project. The project includes several classes that inherit properties from other classes. I ran into just 3 "unresolved external symbol errors - LNK2019". I am using the Visual Studio .NET 2003 platform to develop the application with. I have included the source files with this post and you can recreate the project by creating a new Win32 Console Application project named "use_student", and simply add the files into your project. Any help would be much appreciated! Thank you, Rob Hyland NOTE: if you just see a line of code that says "#include" all by itself it should read "#include (bracket symbol) iostream (bracket symbol)" *************************************************************************************************** *********************************** Header Files ************************************************** // ////////////////////////////////////////////////////////////// // Listing 13.3 studentc.h. / // studentc.h -- defining a Student class using containment / ////////////////////////////////////////////////////////////// // // #ifndef _STUDNTC_H_ #define _STUDNTC_H_ #include #include "arraydb.h" // -- ArrayDB objects. #include "strng2.h" // -- String objects (from Chapter 11). using namespace std; class Student { private: String name; ArrayDb scores; public: Student() : name("Null Student"), scores() {} // -- Use initialization syntax to init. objects. Student(const String & s) : name(s), scores() {} Student(int n) : name("Nully"), scores(n) {} Student(const String & s, int n) : name(s), scores(n) {} Student(const String & s, const ArrayDb & a) : name(s), scores(a) {} Student(const char * str, const double * pd, int n) : name(str), scores(pd, n) {} ~Student() {} double & operator[](int i); const double & operator[](int i) const; double Average() const; // friends friend ostream & operator<<(ostream & os, const Student & stu); friend istream & operator>>(istream & is, Student & stu); }; #endif // ///////////////////////////////////////// // strng1.h -- string class definition / ///////////////////////////////////////// // // #include using namespace std; #ifndef _STRNG1_H_ #define _STRNG1_H_ class String { private: char * str; // pointer to string int len; // length of string public: String(const char * s); // constructor String(); // default constructor String(cons