Using new to allocate an array of class elements with an overloaded constructor in C++.
- by GordoN
As an example say I have a class foo that does not have a default constructor but one that looks like this
foo:foo(int _varA,int _varB)
{
m_VarA = _varA;
m_VarB = _varB;
}
How would I allocate an array of these.
I seem to remember trying somthing like this unsuccessfully.
foo* MyArray = new foo[100](25,14).
I don't think this will work…