mercredi 13 juillet 2016

lvalue required as left operand of assignment in an exercise [on hold]

I am new to C++ and coding so I have no idea how to deal with this problem. Line 3 and 19 give me the following error: "lvalue required as left operand of assignment".

Can someone please explain me why and tell me how to fix this?

 1   for (int x; x<11;x++){
 2    
 3   if ( round1 ==  ai[x] && round1 = 1){
 4       cout << "You both get 3 points.";
 5        score += 3;
 6        aiscore += 3;
 7        return 0;

 8   }
 9    if (round1 > ai[x]){
10        cout << "the A.I. gets 5 points and you get none";
11        aiscore += 5;
12        return 0;
13   }
14    else if (round1 < ai[x]){
15        cout << "You get 5 points and the A.I. gets none.";
16        score += 5;
17        return 0;
18    }
19    else if (round1 == ai[x] && round1 = 0){
20        cout << "You both get 1 point.";
21        score += 1;
22        aiscore += 1;
23        return 0 ;
24    }

Aucun commentaire:

Enregistrer un commentaire