CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    2

    Help with this stupid error -.-

    I'm just getting into programming and was wondering if someone out there in the community could help.

    To start, I'm making a Rock-Paper-Scissors game with a sort of "scoreboard" in it.
    When I try to compile it, however, this stupid error pops up:

    "error C2106: '=' : left operand must be l-value

    Here's that little snippet of the code and what I have used as header files (and other things):

    #include <iostream>
    #include <cstdlib>
    #include <ctime>

    using namespace std;

    int main()
    {
    int a, b, c, d, e, f;

    d = 0;
    e = 0;
    f = 0;

    ...

    if ( a == b ) {
    cout<<"It's a tie!\nBoth of you picked the same thing!\n";
    f + 1 = f;
    }

    if (( a == 1 && b == 3 ) || ( a == 2 && b == 1 ) || ( a == 3 && b == 2 )){
    cout<<"You won!\n";
    d + 1 = d;
    }
    else if ( a != b ) {
    cout<<"The computer won!\n";
    e + 1 = e;
    }
    ...


    Would someone care to help!


    EDIT (MAJOR):
    AHHHH! Stupid, stupid, stupid!

    e = e + 1
    etc.

    God... I hate myself.
    Last edited by Terms; May 15th, 2009 at 07:02 PM. Reason: Idiocy (screw spelling)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured