-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
35 lines (26 loc) · 943 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "mediaobject.h"
#include "photo.h"
#include "video.h"
#include "film.h"
int main(){
/* test des objets */
MediaObject* m = new MediaObject ("m",1,"C/Desktop");
m->print();
MediaObject** tab = new MediaObject*[5];
unsigned int count = 0;
tab[count++] = new Photo ("test_1",1 ,"C/Desktop", "Telecom");
tab[count++] = new Video ("test_2",2 ,"C/Desktop", 15);
tab[count++] = new Photo("test_3",3 ,"C/Desktop", "Bordeaux");
tab[count++] = new Video("test_4",4 ,"C/Desktop", 35);
tab[count++] = new Video("test_5",2 ,"C/Desktop", 40);
for(int i=0; i<5; i++) {
tab[i]->print();
cout << "\n";
}
cout << "\ntest de film et des tableaux";
int chapters [3] = {1, 2, 3};
Film* film_1= new Film ("premierFilm", 1258,"~/Desktop",50,3,chapters);
film_1->print();
chapters[0] = 5; // on verifie que le tableau a bien etait copie
film_1->print();
}