Vectors of Object
I have:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include "A.h"
class A; //Forward Declared
class B
{
vector <A> v1;
public:
B(A &a)
{ ...
}
v1.push_back(obj);
cout<<*v1[0].display();
};
|
I am getting an error of forward Declaration of 'class A'
What is the best way to resolve this problem.
Why are you forward declaring it? Not only do you not need it, but it's actually causing an error.
Please provide actual error messages and actual code that reproduces your problem.
Topic archived. No new replies allowed.