Using VS2012, I have encountered an unprecedented problem, my main class have a member, which is a an array of another small class. This small class has an explicit constructor. Now the problem: How to supply the initialization list?
The following is the code:
class A { //This is the small class private: int value; public: explicit A(int newNumber) { value = newNumber; } }; class B {//This is the major class private: A arrayOfA[5]; public: B() {//Compiler complain "no default constructor for class A" //But I really don't know how to supply the initialization list } }; Thanks a lot!