URL: https://linuxfr.org/forums/programmation-c/posts/fichier-den-t%C3%AAte-fichh Title: fichier d'en tête fich.h Authors: cielleau Date: 2007年06月26日T16:58:02+02:00 Tags: Score: 0 Bonjour à tous voici mon code #ifndef _BD_H_ #define _BD_H_ using namespace std; £spaces£ £/spaces£ class voiture { £spaces£ £/spaces£private: string nvhe; £spaces£ £/spaces£string couleur; £spaces£ £/spaces£string marque; £spaces£ £/spaces£int km; £spaces£ £/spaces£Personne *proprietaire; £spaces£ £/spaces£public: voiture(); £spaces£ £/spaces£~voiture(); £spaces£ £/spaces£//voiture(); £spaces£ £/spaces£int rouler(int distance); £spaces£ £/spaces£void enregistrer_vehicule(voiture *V1); £spaces£ £/spaces£void afficher_vehicule(voiture *V1); £spaces£ £/spaces£Personne *get_proprietaire(voiture *V1); £spaces£ £/spaces£}; £spaces£ £/spaces£ class Personne{ £spaces£ £/spaces£string nss; £spaces£ £/spaces£string nom; £spaces£ £/spaces£string prenom; £spaces£ £/spaces£string datenaissance; £spaces£ £/spaces£voiture *Veh; £spaces£ £/spaces£public:Personne(); £spaces£ £/spaces£void enregistrer(Personne *P); £spaces£ £/spaces£int viellir(); £spaces£ £/spaces£void afficher(Personne *P); £spaces£ £/spaces£void dormir(); £spaces£ £/spaces£void posseder_voiture(Personne *P1); £spaces£ £/spaces£int age(); £spaces£ £/spaces£}; j'obtiens après compilation: In file included from BD.cpp BD.h ISO C++ forbids declaration of `Personne' with no type BD.h expected `;' before '*' token BD.h ISO C++ forbids declaration of `Personne' with no type BD.h expected `;' before '*' token BD.cpp In constructor `voiture::voiture()': BD.cpp `proprietaire' undeclared (first use this function) BD.cpp 'class voiture' has no member named 'proprietaire' je n'arrive pa à décoder ce message d'erreur. aidez moi. merci d'avance.

AltStyle によって変換されたページ (->オリジナル) /