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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuga kariem
    New Member
    • Dec 2012
    • 1

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

    Code:
    #include<iostream.h>
    main()
    {
      float a;
      cout<<--a++;
     }
    What does it mean by error
    no name eo2.cpp 6 :lvalue required in function main
    Last edited by Meetee; Dec 12 '12, 01:02 PM. Reason: Use code tags <code/> around your code.
  • PreethiGowri
    New Member
    • Oct 2012
    • 126

    #2
    At line 5 you are trying to do both decrement and increment operation which is resulting to this error.
    do something like this
    Code:
    float b=--a;
        cout<<b;
      float c= b++;
      cout<<c;

    Comment

    Working...