Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8673471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:28:04+00:00 2026-06-12T19:28:04+00:00

Why lvalue required as increment operand Error In a=b+(++c++); ? Just Wanted to assign

  • 0

Why lvalue required as increment operand Error In a=b+(++c++); ?

Just Wanted to assign ‘b+(c+1)’ to ‘a’ and Increment ‘C’ by 2 at the same time.

I’M A Beginner Just Wanted A Clarification About What “LVALUE ERROR” Actually Is?

main()
{

int a=1,b=5,c=3;

a=b+(++c++);  

printf("a=%d   b= %d   c= %d \n",a,b,c);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:28:05+00:00Added an answer on June 12, 2026 at 7:28 pm

    Postfix increment binds tighter than prefix increment so what you would want would be something like:

    a = b + (++c)++;
    

    This is not legal C, though, as the the result of prefix increment (like the result of postfix increment in your example) is not an lvalue. This means that it’s just a value; it doesn’t refer to a particular object like ‘c’ any more so trying to change it makes no sense. It would have no visible effect as no object would be updated.

    Personally I think that doing it in two statements is clearer in any case.

    a = b + c + 1;
    c += 2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the error (Lvalue required as left operand of assignment) for this code:
Hello I get the Lvalue required as left operand of assignment error in xcode.
The following code produces a lvalue required as left operand of assignment if( c
Below code gives error on compilation in a C compiler ++(-i); error: lvalue required
Possible Duplicate: Error: lvalue required in this simple C code? (Ternary with assignment?) In
Following is line of code in c. i++=i++; Output:Error Lvalue required. So what does
The compiler gives an error on this statement. i>=3?b=10:b=5; error: lvalue required as left
i am getting an error: invalid lvalue in assignment. this is the only error
Just wonder if a literal string is an lvalue or an rvalue. Are other
Following program gives error #include<stdio.h> int main () { int a=10,b; a>=5?b=100:b=200; printf(\n%d,b); }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.