consolidate all repos to one for archive
This commit is contained in:
31
semester_2/programiranje_2/primeri/Example25/main.cpp
Normal file
31
semester_2/programiranje_2/primeri/Example25/main.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
#include "Person.h"
|
||||
#include "Student.h"
|
||||
#include "Assistant.h"
|
||||
#include "StudentAssistant.h"
|
||||
|
||||
int main() {
|
||||
Person o1("Anna");
|
||||
Student s1("Mark", "FERI", 8.3);
|
||||
Assistant a1("Mary", "FKKT", "Introduction to chemistry");
|
||||
StudentAssistant sa1("John", "FNM", 10, "FERI", "Discrete math");
|
||||
|
||||
o1.print();
|
||||
s1.print();
|
||||
a1.print();
|
||||
sa1.print();
|
||||
/*
|
||||
std::cout << "--------------" << std::endl;
|
||||
Person* society[4];
|
||||
society[0]=&o1;
|
||||
society[1]=&s1;
|
||||
society[2]=&a1;
|
||||
//society[3]=&a1;
|
||||
society[3]=&sa1; //without virtual derivation class StudentAssistant can not be converted to class Person
|
||||
for (int i=0; i < 4; i++) {
|
||||
society[i]->print();
|
||||
}
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user