2012-03-29 62 views
-4

为什么我收到此错误消息?此行的错误消息

Error: expected a ';' 

来自:

int main() 
{ 
    int score; 
    double distance; 
    char playAgain; 
    bool shieldsUp; 

    short lives; 
    short aliensKilled; 

    score = 0 
    distance = 1200.76; 
    playAgain = 'y'; 
    shieldsUp = true; 
    lives = 3 
    aliensKilled = 10; 

误差为distance = 1200.76;aliensKilled = 10;下,

+0

你知道,缺少分号...看看一行。然而,如果你躲避敌人,那么不要依赖忘记仰望的人:往往最好的藏身之处就在地面上(只是小费)。 – 2012-03-29 01:08:11

+2

请购买[C++书籍](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)并阅读它! – 2012-03-29 01:09:25

回答

1

您有:

score = 0 

你想:

score = 0; 

类似的lives = 3

1

你真的忘了的东西:

... 
score = 0; 
... 
lives = 3; 
...