-4

Why do i get this error message?

Error: expected a ';'

from:

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;

the error is under distance = 1200.76; and aliensKilled = 10;,

Kristian Glass
  • 37,325
  • 7
  • 45
  • 73
  • u know, a missing semicolon... look up one line. however, if you're hiding from an enemy then don't rely on people forgetting to look up: often the best hiding place is then down on the ground (just a tip). – Cheers and hth. - Alf Mar 29 '12 at 01:08
  • 2
    Please buy a [book on C++](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) and read it! – Jesse Good Mar 29 '12 at 01:09

2 Answers2

1

You have:

score = 0

You want:

score = 0;

Similar for lives = 3

Kristian Glass
  • 37,325
  • 7
  • 45
  • 73
1

You really forgot something:

...
score = 0;
...
lives = 3;
...
iehrlich
  • 3,572
  • 4
  • 34
  • 43