// Example program
#include <iostream>
#include <string>
using namespace std;
class table
{
int size;
int priority;
public:
table(int s=0, int p=0):size(s),priority(p){}
virtual void print();
};
class stud_table: public table
{
char *name;
int gr;
public:
void print(){ cout <<"students table"<<endl; }
~stud_table(){ delete []name; }
};
class asp_table: public table
{
char *thesis;
};
int main()
{
table t;
stud_table st;
table *tp=&st;
tp = new asp_table();
stud_table *stp = &st;
cout << "Program" << endl;
return 0;
}
/* Why I get link errors: Error 2 error LNK1120: 1 unresolved externals
Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall table::print(void)" (?print@table@@UAEXXZ)
*/