C#, absolute beginner getting CS1513 C# } expected error

前端 未结 5 716
深忆病人
深忆病人 2021-01-29 08:52

This is my very first day of programming without having any programming background. I was trying the below code. Please click the below link for the screenshot.

CS1513

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-29 09:37

    Your if statement has a semicolon on the end, if you remove that it will compile just fine!

    From

    (uservalue == 1) ;
    {
        //code
    }
    

    To

    (uservalue == 1)
    {
        //code
    }
    

提交回复
热议问题