Error:error C2143: syntax error: missing ';' が表示されます ビジュアルスタジオの「:」の前
次の cpp コードの場合。このエラーが発生する理由を誰か説明できますか?
助けてくれてありがとう
#include<iostream>
using namespace std;
#define UP '1';
#define DOWN '2';
#define RIGHT '3';
#define LEFT '4';
void main()
{
char key ;
char value = 'x';
cout<<"Enter 1 or 2 or 3 or 4"<< endl;
cin>>key;
switch(key)
{
case UP :
cout<<"case UP"<<endl;
break;
case DOWN:
cout<<"case DOWN"<<endl;
break;
case LEFT:
cout<<"case LEFT"<<endl;
break;
case RIGHT:
cout<<"case RIGHT"<<endl;
break;
}
}