[debutant]Utiliser friend method
J'ai une erreur de compilation a cause de l'utilisation d'une classe friend :
Citation:
main.cpp:
Error E2176 plane.h 14: Too many types in declaration
*** 1 errors in Compile ***
FlyingMachine.cpp:
plane.cpp:
Error E2176 plane.h 14: Too many types in declaration
*** 1 errors in Compile ***\
main.cpp :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
class plane: public FlyingMachine
{
//
#include"temps.h"
//
private:
bool landingGearOn; // is the landing gear retracted or not ?
//this state is private because we dont use it elsewhere
char name;
public :
// those methods are public as we need to use them
plane();//penser a utiliser flyingmachine() pour definir cette fonction.
plane(char name);
void forecast(temps t); |
temps.h :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| #ifndef temps_h //It checked it has been defined
#define temps_h
class temps
{
bool nice;
friend class plane;
public :
weather(bool nice);
} |
D ou ca peut venir l'erreur tout semble correct ...