<分区>
我正在用 C 写一个脑残的解释器,我在使用一些我不习惯的东西时遇到了一些麻烦。在 brainfuck 中,逗号 (,) 本质上是 getchar()。所以我有以下代码:
//This is just ptr
static char *ptr;
switch (command)
{
case ',':
*ptr=getchar(); // Here's the code causing error
break;
}
当我尝试编译它时,gcc 向我抛出 error: a label can only be part of a statement and a declaration is not a statement
。
有什么想法吗? (抱歉,对这个错误不是很熟悉)