J
Josh Mcfarlane
If the constructor for one of the objects within a class takes a
parameter of the constructor for the class and modifies it, when the
parameter is used in the constructor will it be the original parameter,
or the modified parameter after the initialization list?
Ex:
ClassA::ClassA(unsigned int& Parameter)
{
Parameter += 1;
}
ClassB::ClassB(unsigned int& ParameterB)
:ClassA(ParameterB)
{
Foo = Parameter;
}
In this case, if someone calls initializes the object as ClassB(0),
will Foo be 0 or 1?
Thanks,
Josh McFarlane
parameter of the constructor for the class and modifies it, when the
parameter is used in the constructor will it be the original parameter,
or the modified parameter after the initialization list?
Ex:
ClassA::ClassA(unsigned int& Parameter)
{
Parameter += 1;
}
ClassB::ClassB(unsigned int& ParameterB)
:ClassA(ParameterB)
{
Foo = Parameter;
}
In this case, if someone calls initializes the object as ClassB(0),
will Foo be 0 or 1?
Thanks,
Josh McFarlane