Thread: Stupid Error That I'm Drawing a Blank On

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    109

    Stupid Error That I'm Drawing a Blank On

    heres the error and the line it talks about

    Code:
    main.cpp: In function ‘int hash(std::string, int)’:
    main.cpp:76: error: invalid lvalue in assignment
    make: *** [main] Error 1
    
    
    
    
      int length = item.length();
     75     int answer = 0;
     76     if(length % 2 = 0)
     77     {
     78         answer = item.at(length - 1);
     79         length--;
     80     }
     81

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Look really closely at line 76. Notice the error message talks about an assignment. Do you really want to do an assignment there?

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    109
    ah thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with deleting completely blank lines
    By dnguyen1022 in forum C Programming
    Replies: 3
    Last Post: 12-07-2008, 11:51 AM
  2. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 05:09 PM
  3. How to do double buffing with win32 drawing?
    By Josh Kasten in forum Windows Programming
    Replies: 2
    Last Post: 03-27-2004, 12:02 AM
  4. GDI Drawing a stupid line!
    By Bajanine in forum Windows Programming
    Replies: 4
    Last Post: 05-08-2003, 09:00 PM
  5. Check for a blank cd-r
    By waldis in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2003, 06:16 PM