Visual Studio 中文字整数赋值的奇怪行为导致四个意外的编译器错误
Strange behavior with literal integer assignment in Visual Studio results in four unexpected compiler errors
复制这一行并将其粘贴到 Visual Studio(即不要输入它,因为那样不会产生错误)。它会产生以下四个编译器错误。当我将它粘贴到 Notepad++ 中时,我看不到任何不可见的字符。怎么回事?
int x = 28452;
以下是四个编译器错误:
CS1056 Unexpected character ''
CS1002 ; expected
CS1525 Invalid expression term ''
CS0201 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
赋值前=后有一个字符
复制这一行并将其粘贴到 Visual Studio(即不要输入它,因为那样不会产生错误)。它会产生以下四个编译器错误。当我将它粘贴到 Notepad++ 中时,我看不到任何不可见的字符。怎么回事?
int x = 28452;
以下是四个编译器错误:
CS1056 Unexpected character ''
CS1002 ; expected
CS1525 Invalid expression term ''
CS0201 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
赋值前=后有一个字符