Invalid token 'while' in class, struct, or interface member declaration in very simple code

后端 未结 5 589
你的背包
你的背包 2021-01-02 17:57

I am not sure what the problem is but I keep receiving this error when I try to use a while statement in my code.

Invalid token \'while\' in class,

5条回答
  •  萌比男神i
    2021-01-02 18:36

    C# is not allowed to write code directly into the classes; it is allowed to write only data members and function members directly into the classes.

提交回复
热议问题