By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,650 Members | 1,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,650 IT Pros & Developers. It's quick & easy.

error no name eo2.cpp 6 :lvalue required in function main

P: 1
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. main()
  3. {
  4.   float a;
  5.   cout<<--a++;
  6.  }
What does it mean by error
no name eo2.cpp 6 :lvalue required in function main
Dec 12 '12 #1
Share this Question
Share on Google+
1 Reply


100+
P: 126
At line 5 you are trying to do both decrement and increment operation which is resulting to this error.
do something like this
Expand|Select|Wrap|Line Numbers
  1. float b=--a;
  2.     cout<<b;
  3.   float c= b++;
  4.   cout<<c;
Dec 13 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.