Bonjour,
j'ai en fait construit une classe GRAPH et par la suite une classe GHRAPH_ORIENTE qui l'hérite et possède les mêmes attributs
voici le code:
graph.h
graph.cpp
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef GRAPH_H #define GRAPH_H using namespace std; #include<string> #include"sommet.h" #include<vector> class GRAPH {int nb_arc; int nb_sommet; std::vector<Sommet*>accesseur; public: GRAPH(int nbr_arc , int nbr_sommet ); ~GRAPH(); void Bellman(); void Dijkstra(); void DFS(); void BFS(); void Bellaman_amel(); void Floyd_Warshall();
graph_oriente.h
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include "graph.h" using namespace std; #include<string> #include"sommet.h" GRAPH::GRAPH(int nbr_arc , int nbr_sommet ) {nb_arc=nbr_arc; nb_sommet=nbr_sommet; accesseur.reserve(100); } GRAPH::~GRAPH() { //delete[]accesseur;// }
graph_oriente.cpp
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef GRAPH_ORIENTE_H #define GRAPH_ORIENTE_H using namespace std; #include<string> #include"graph.h" #include"sommet.h" class GRAPH_ORIENTE : public GRAPH { public: GRAPH_ORIENTE(int , int ); ~GRAPH_ORIENTE(); void Edmonds_karp(); void FORD_FULKERSON(); void BUSACKER_GOWEN(); protected: }; #endif
le compilateur m'affiche l'erreur suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include "graph_oriente.h" using namespace std; #include<string> #include"graph.h" GRAPH_ORIENTE::GRAPH_ORIENTE(int nb_arc,int nb_sommet):GRAPH(int nb_arc,int nb_sommet) { } GRAPH_ORIENTE::~GRAPH_ORIENTE() { }
C:\Users\KHADIJA\Desktop\deb\graph_oriente.cpp In constructor 'GRAPH_ORIENTE::GRAPH_ORIENTE(int, int)':
7 62 C:\Users\KHADIJA\Desktop\deb\graph_oriente.cpp [Error] expected primary-expression before 'int'
aidez moi SVP
Partager