blob: c2908c4b4fd4930183441e1aa6a7935048674462 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <iostream>
#include "Person/Person.h"
#include "Student/Student.h"
#include "Teacher/Teacher.h"
int main()
{
char subjects[3][20] = { "English", "Mathematics", "Physics" };
char** subjectsPointers = new char* [3];
subjectsPointers[0] = subjects[0];
subjectsPointers[1] = subjects[1];
subjectsPointers[2] = subjects[2];
Teacher t("Prof. Ivanov", 33, subjectsPointers, 3);
std::cout << t.getName() << std::endl;
delete[] subjectsPointers; //only the pointers - not the data!
}
|