Does anyone know how to get this code to work? It compiles fine in Visual Studio, but not in Borland. I need this to work in Borland.
All I want to do is locally decare an array of classes within a class, and initalise them to their relevant values. However, in Borland I keep getting these errors:
[C++ Error] x.h(21): E2034 Cannot convert 'A' to 'A[3]'
[C++ Error] x.h(28): E2176 Too many types in declaration
Any help would be greatfulCode:class A { public: A(int i) : m_i(i) {} protected: int m_i; }; class B { public: B() : m_A(A(1), A(2), A(3)) {} protected: A m_A[3]; }