Thread: must be a modifiable lvalue error

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    That's good. Now, if you want to learn more on how to do this well, read up on the stuff in <algorithm>. You can use a generic algorithm to "remove" the characters that are vowels (actually shifting them to the back rather than really removing them), then use the range version of erase to remove them for good at one go.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    Registered User
    Join Date
    Jun 2011
    So when i want something to literally equal 0 i do one and when i want it to emulate something its two equal signs?
    I feel that you're not grasping the core difference here. To water it down:

    The assignment operator (=) makes one thing another (changes its value).

    The comparison operator (==) checks to see if one thing is the same as another (checks its value).

        int a;
        a = 15;
    So this code declares an integer called 'a', then assigns it a value of 15.

        int a;
        a = 15;  /* assigns a value of 15 to 'a' */
        if(a == 20)  /* compares the value of 'a' to 20; 20 is not 15, so this fails */
            printf("'a' is 20\n");
            printf("'a' is not 20\n");
    This code declares an integer called 'a', assigns it a value of 15, and checks to see if it's equal to 20.

  3. #18
    Join Date
    Oct 2007
    Inside my computer
    For future reference, std::out_of_range means you are trying to access an element that does not exist.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. error: lvalue required, pretty sure it's an lvalue
    By brandones in forum C Programming
    Replies: 18
    Last Post: 08-22-2011, 08:06 PM
  2. lvalue error
    By roaan in forum C Programming
    Replies: 6
    Last Post: 08-13-2009, 10:09 PM
  3. modifiable lvalue error
    By tsantana in forum C Programming
    Replies: 2
    Last Post: 06-10-2009, 10:58 PM
  4. non-lvalue error
    By zlb12 in forum C Programming
    Replies: 1
    Last Post: 04-17-2009, 10:43 AM
  5. lvalue error
    By paperbox005 in forum C Programming
    Replies: 4
    Last Post: 04-10-2005, 12:18 AM

Tags for this Thread