Im下面的代碼獲取以下錯誤:「表達式列表視爲複合表達式」。我無法找出什麼是錯的?C + +構造函數錯誤
Shoot::Shoot() :
io(IOManager::getInstance()),
count(0),
locX(0),
locY(0),
objWidth(0),
objHeight(0),
clock(Clock::getInstance()),
ticks(0),
bulletSurface(io.loadAndSet("images/bullet.bmp", true)),
bulletFrame(bulletSurface, 30, 30, 0, 0),
thebullet(Vector2f(700,760), Vector2f(20,45), "bullet" , &bulletFrame)
{
}
聲明:
private :
const IOManager& io;
int count;
int locX;
int locY;
unsigned objWidth;
unsigned objHeight;
Clock& clock;
unsigned ticks;
SDL_Surface *bulletSurface;
Frame bulletFrame;
Sprite *thebullet;
Shoot(const Shoot&);
Shoot& operator=(const Shoot&);
我修改了代碼段中的空白,以便更容易地看到發生了什麼。 – 2012-03-25 22:50:16
看看這個問題:[鏈接](http://stackoverflow.com/questions/877107/c-error-member-initializer-expression-list-treated-as-compound-expression) – Vincent 2012-03-25 22:50:57