solve C# error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rashmi55
    New Member
    • Mar 2010
    • 3

    solve C# error

    I m just now started learning C#.net. I m getting error "The left-hand side of an assignment must be a variable, property or indexer" what its meaning?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    It means you *can* say:
    int x = 5;

    you can *not* say:
    6 = 9;

    Think back to your 6th grade algebra.
    The right side of an equation is calculated and assigned to the left side.
    X = 7 + 6 + 5;
    The right side is evaluated: 7 + 6 is 13 + 5 is 18
    X = 18;
    The value of 18 is assigned to X

    The error is telling you that the left side of your equation is not something you can assign to like a variable or a property or an indexer.

    Comment

    Working...