em dang làm bài tập thì gặp lỗi như thế này
(em viết vắn tất thôi ạ)
file a.h
#ifndef a_H
#define a_H
class a
{
private:
	b* bVar;
public:
	friend class b;
};
#endif
file b.h
#ifndef b_H
#define b_H
class b
{
private:
	a* aVar;
public:
	b();
 	friend class a;
};
#endif
file a.cpp
#include<iostream>
#include"a.h"
#include"b.h"
using namespace std;
file b.cpp
#include<iostream>
#include"a.h"
#include"b.h"
using namespace std;
b::b()
{
	aVar = new a;
	aVar->bVar = this;
}
thì lúc này dòng
aVar->bVar = this;
bị báo lỗi <error-type> *a::bVar
đây là lỗi gì vậy ạ?
 
      
    
 83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?
    83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?