之前还没怎么注意,在switch语句块里面,在定义变量会报以下错误。
a label can opart of a statement and a declaration is not a statement|
可以采取 在定义变量的地方加大括号,暂时还不太清楚为啥,先记着吧,毕竟也是坑了我的,也是不懂的。
case 4:
{
int a = listlength(p1);
printf("长度 %d \n",a);
}
break;