Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Class Member Object Inheritance

Class Member Object Inheritance

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studiooophelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hyland Computer Systems
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups