I want to create a new array of a class I have created. But when I create it, I don't want to have to call a default constructor.
This is the code I have:
1 2 3 4 5 6 7 8 9 10 11 12 13
Shapes *list = new Shapes[ 7 ];
for( int i = 0; i < 7; ++i )
{
list[ i ].setShapeType( i );
list[ i ].setPosition( 30, 3 );
list[ i ].setFacing( UP );
shapeList.push_back( list[ i ] );
}
delete[] list;
list = NULL;
And this is the class I'm creating an object of:
1 2
Shapes( int type, int x, int y, facing d );
~Shapes(void);