There are several build problems.
At the beginning the compiler is complaining about the attribute initialization in the default constructor:
1) The type of size (int) is not recognized although I declared it in the input argument of the constructor.
2) It is not possible to assign the null value to the int* mArray
Does somebody know why I am not allow to do 1) and 2)?
Thanks. Got it! No semicolon after the constructor when we want to initialize attributes.
Does an array size of 0 make sense? Sensible minimum value would be 2
Why do you say that the sensible minimum value would be 2?
In my point of view if the constructor is instantiated without specifying the size there is no array. Therefore size 0...
Yes, I understood that the constructor is also a function that does not return a value. So for the semicolon rule it is the same as functions. When defining a function don't put semicolon after the signature =).
Why do you say that the sensible minimum value would be 2?
In my point of view if the constructor is instantiated without specifying the size there is no array. Therefore size 0...
Why would you create an array that you can't use? Just to waste CPU cycles?
If the size of the array is somewhere calculated zero might be just a bug.
An array with size one makes also no sense since you can save resources and use a single var.
Well, don't std::string and std::vector (just for example) by default get constructed with a size of zero? Though of course those have multiple different options, the empty object may or may not be the best choice depending on the situation.