I am wondering if there is a way I can, in my class' constructors, initialize an array in the base initialization list.
Right now, I am initializing myChars (a char*) to an empty character array of size DEFAULT_SIZE:
A::A() :
mySize(0), maxSize(DEFAULT_SIZE)
{
myChars = new char[DEFAULT_SIZE];
}
Is there any way to do this in the base initialization list? So that it would be simply:
A::A() :
mySize(0), maxSize(DEFAULT_SIZE), **myChars initialized here**
{
}
Thanks!