【发布时间】:2015-01-04 15:56:14
【问题描述】:
Visual Studio 给我这个错误消息:“检测到无法访问的代码”。谁能告诉我我的代码有什么问题?:
string commandWord = command.CommandWord; //--> here I get the error message
switch (commandWord)
(
case "help":
printHelp();
break;
case "go":
goRoom (command);
break;
case "pick":
pickUp (command);
break;
)
【问题讨论】:
-
在 switch case 之后应该是 { code } 。把你的代码放在花括号里。