Lvalue required in function main

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ehab mohamed
    New Member
    • May 2010
    • 18

    Lvalue required in function main

    When i try to run this program it give me a message that Lvalue required in function main. What is the cause?
    Attached Files
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Use comparison == instead of assignment = in you if statement.

    An lvalue is a something that can be assigned to more or less.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      By the way, you might prefer to change your printf format string from "%d" to "%d\n". The newline is needed because stdout is typically buffered I/O.

      Comment

      Working...