Stupid Error That I'm Drawing a Blank On

This is a discussion on Stupid Error That I'm Drawing a Blank On within the C++ Programming forums, part of the General Programming Boards category; 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 ...

  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,328
    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, 10: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-26-2004, 11:02 PM
  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, 05:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21