网站首页
编程语言
数据库
系统相关
其他分享
编程问答
wstatus
2024-05-25
GCC编译遇到“a label can only be part of a statement and a declaration is not a statement”问题
问题原因:switch中case里面的局部变量出错解决方法:将case里面定义的局部变量在switch外面定义。//报错情况switch(fork()){case-1:error(1,errno,"fork");case0://子进程执行命令if(execvp(args[0]