Hello, I'm pretty sure that this question is very noob but I'm not used to C++.
I have a .hpp for class definition and a .cpp for class implementation. I have some private instances on the class, for example:
class Test
{
Test(void);
private:
SomeClass anInstance;
};
To create the instance and call the constructor do I must define it again at the constructor of the class?
Test::Test(void)
{
SomeClass anInstance(constructor parameters);
}
Thanks in advance!
EDIT:
Mmmm, sorry but I don't catch what you're talking about so let me show you a better example:
class A
{
public:
A(int p1,int p2);
}
class B
{
public:
B(A *p1,int p2);
}
class C
{
public:
C(void);
private:
A instanceA;
B instanceB;
}
Then, at the implementation of the constructor of the class C I want to create instanceA and pass it to the constructor of instanceB. Hope this clarifies the question.