Create 'new' array of class, calling non-default constructor?

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);


Is there a way I can call the first constructor?

Thanks.
I think this would work:
Shapes* list = new Shapes(type, x, y, d) [7];
but normally I would just use a vector:

1
2
3
std::vector<Shapes> list;
for ( int i = 0; i < 7 ; ++i )
    list.push_back( Shapes(type,x,y,d) );
Oh wow, didn't think of doing it like that!! Thanks a lot for the reply!!

Topic archived. No new replies allowed.