Witam.
Mam takie oto diw przykładowe klasy:
A.h
#ifndef A_H
#define A_H
#include "struktury.h"
#include "B.h"
class A
{
private:
int liczba;
B *b;
friend class B;
public:
void funkcja()
{
//cos robie
}
void funkcja_2()
{
b->funkcja_b( this );
}
};
#endif
B.h
#ifndef B_h
#define B_h
#include "struktury.h"
#include "A.h"
#include <vector>
class A;
class B
{
private:
/*...*/
public:
/*..*/
void funkcja_b( A *a )
{
a->funkcja();
int liczba = a->liczba;
}
};
#endif
I mam problem poniewarz kompilator daje błędy typu:
1> error C2027: use of undefined type 'A'
przy: a->funkcja();
w pliku B.h w funkcji funkcja_b()
Nie bardzo wiem jak to obejść, więc zwracam się do Was z prośbą o pomoc :)