Assuming I have a class:
How would I initialize all elements of values to 0 in the constructor initializer list?Code:class A
{
int[8] values;
};
Printable View
Assuming I have a class:
How would I initialize all elements of values to 0 in the constructor initializer list?Code:class A
{
int[8] values;
};
As far as I know, you can't. In this case it doesn't matter that much though, you could do it in the constructor's body. But when you have something other then ints it could be a problem.
I have pointers, so it isn't a problem. I was just looking for a way because it makes inlining easier for the compiler.