本人写了这个代码,问下错在哪里?51不能用swith吗
swith(judge)
{
case 0xd7:num=0;break;
case 0xea:num=1;break;
case 0xda:num=2;break;
case 0xaa:num=3;break;
case 0xed:num=4;break;
case 0xdd:num=5;break;
case 0xad:num=6;break;
case 0xee:num=7;break;
case 0xde:num=8;break;
case 0xae:num=9;break;
case 0xe7:num=10;break;//"on/cc"
case 0x77:num=11;break; //"+"
case 0x7a:num=12;break; //"-"
case 0x7d:num=13;break; //"x"
case 0x7e:num=14;break; //"/"
case 0xa7:num=15;break; //"="
default:;
}
运行后出错为:
BIT KEYBOARD.C(46): warning C276: constant in condition expression
BIT KEYBOARD.C(64): warning C206: 'swith': missing function-prototype
BIT KEYBOARD.C(64): error C267: 'swith': requires ANSI-style prototype
BIT KEYBOARD.C(65): error C141: syntax error near '{'
BIT KEYBOARD.C(66): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(66): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(67): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(67): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(68): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(68): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(69): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(69): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(70): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(70): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(71): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(71): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(72): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(72): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(73): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(73): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(74): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(74): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(75): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(75): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(76): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(76): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(77): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(77): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(78): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(78): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(79): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(79): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(80): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(80): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(81): error C172: 'case': missing enclosing switch
BIT KEYBOARD.C(81): error C171: 'break': missing enclosing loop
BIT KEYBOARD.C(82): error C172: 'default': missing enclosing switch
bit keyboard.c - 35 Error(s), 2 Warning(s).