LoginSignup
1
1

More than 5 years have passed since last update.

VS2015でvar c = '!';が何故か「c#で文字リテラルに文字が多すぎます。」というエラーになる

Posted at

VS2015にアップグレードしてコンパイルするとエラー発生。

CharSample
var c1 = '!!';//エラー。文字が二つはエラーになるよ
var c2 = '!';//何故かエラー!文字一つなのになんで?

結論を言うとファイルの文字コードがShift-JISになっていました。
ファイルを開いてメニューバーのファイル→保存オプションの詳細設定から変更可能。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1