my code is ok.
leave my code, here is an example of the same problem.
this is the Abstract:
Code:
#include "C.h"
#ifndef B_H
#define B_H
class B
{
public:
B();
virtual C EX()=0;
};
#endif
Code:
#include "B.h"
#ifndef A_H
#define A_H
class A:public B
{
public :
A();
C EX();
};
#endif
Code:
#include <list>
using namespace std;
#ifndef C_H
#define C_H
template <class T>
struct C
{
list<T> info;
};
#endif
Code:
#include "A.h"
A::A();
template <class T>
C<T> A::EX()
{
C<int> l;
return l;
}
#include "B.h"
B::B(){};
Code:
#include "C.h"
#include "A.h"
using namespace std;
void main()
{
C<B*> l;
list<B*>::iterator iter;
/*
...
*/
for (iter = l.info.begin(); iter!=l.info.end(); ++iter)
{
(*iter)->EX();
}
}
lets say that this is may all code.
how can i fix the compiler error?
this is the compiler error:
error C2036: 'struct C' : unknown size