So you are trying to create an array of CCSprite*
?
I dont have 2.0.4 documentation handy to tell you what default constructors you could take advantage of. so I'll do it a way I know will work.
cocos2d::CCArray* arr = new CCAray();
for (int i=0, i < 5; i++)
{
CCSprite* foo = new cocos2d::CCSprite();
foo->initWithFile( "sprite.png" );
arr->addObject(foo);
}
I dont prefer CCArray
, I just use an std::vector
.
std::vector<CCSprite*> _sprites;
_sprites.reserve(<some initial amount>); // if this makes sense for you.
for (int i=0, i < 5; i++)
{
CCSprite* foo = new cocos2d::CCSprite();
foo->initWithFile( "sprite.png" );
v.push_back(foo);
}