#include <iostream>
using namespace std;
struct testarray{
int element;
public:
testarray(int a):element(a){}
};
class myarray
{
public:
testarray i;
public:
myarray(testarray a) : i(a){ }
} ;
int main()
{
myarray objArray[3] = {1,2,3};
return 0;
}
The above code compiles fine in Visual C++ 2005 Express Edition IDE. But what I want is to prevent the compiler from implicitly typecasting the object type.