error: a label can only be part of a statement and a declaration is not a statement
GCC:
error: a label can only be part of a statement and a declaration is not a statement
switch(a){ swtch(a){
case 1: case 1:
.................... {
.................... ...............
.................... ...............
break; ................
case 2: }
break; break;
} case 2:
break;
}
Error OK
case1:
//此块代码不能再声明变量,如果你声明变量就会报错,除非用括号括起来,这是编译器的问题,也可以说是C语言的规定。写代码的时候注意就成了。就像C语言再声明的时候不能赋值一样,记住就好了。
break;
希望对你有所帮助。
error: a label can only be part of a statement and a declaration is not a statement的更多相关文章
- c 编译异常 switch 之a label can only be part of a statement and a declaration is not a statement
client.c:996: error: a label can only be part of a statement and a declaration is not a statement sw ...
- ERROR 1666 (HY000): Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.
centos7.5 binlog恢复数据失败 问题: mysql> \. /tmp/inc.sql ERROR 1050 (42S01): Table 'new_1' already exist ...
- a label can only be part of statement and a declaratioin is not a statement
参考资料: https://stackoverflow.com/questions/18496282/why-do-i-get-a-label-can-only-be-part-of-a-statem ...
- Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in
学习php的命名空间,直接把手册的代码粘贴过来,却报错了:Fatal error: Namespace declaration statement has to be the very first s ...
- mysqldump 使用--tab=path参数时提示mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement when executing 'SELECT INTO OUTFILE'
报错: [root@zedu test]# mysqldump -h127.0.0.1 -uroot -p --single-transaction --add-drop-database --tab ...
- [ThinkPHP]报错:Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in E:\wamp\www\jdlh\application\index\controller\Index.php on line
错误提示说命名空间声明语句必须是第一句,可我看就是第一句没毛病呀,这是为啥呢,后面发现<?php 前面有个空格,删掉就正常了 去掉空格之后页面能正常显示
- switch的case中不能做定义
switch的case中不能做定义 只能给语句 error: a label can only be part of a statement and a declaration is not a st ...
- 关于gcc的一点小人性化提示
现在对于大多数平台的C编译器来说都会有很多种选择,而gcc和clang无疑是2个非常优秀的C编译器.当然他们也不只是C编译器.我最近用clang的比较多,原因有很多.不过一些小的细节很让我喜欢,比如O ...
- 在switch中的case语句中声明变量编译出错的解决方案
在switch中的case语句中声明变量编译的问题 先来看段代码,别管什么意思: : , j = ; ; i < ; i++) recive_phone[i] = msgbuf.text[i]; ...
随机推荐
- 2013.5.A
题1 高低位交换 [问题描述] 给出一个小于2^32的正整数.这个数可以用一个32位的二进制数表示(不足32位用0补足).我们称这个二进制数的前16位为“高位”,后16位为“低位”.将它的高低位交换, ...
- c#XML配置文件辅助类
在开发中经常会用到各种kv类型的配置 文件,像这样的 <?xml version="1.0" encoding="utf-8" ?> <sou ...
- FineUI开源版之TreeGrid实现
FineUI开源版是没有树表格的,但是又需要,怎么办呢?在博客园看到一位大大的文章 http://www.cnblogs.com/shiworkyue/p/4211002.html 然后参考,不知道为 ...
- SHELL编程笔记(二)之shell流程控制
Shell控制流程结构 本章内容有: 退出状态 While.for和until loops循环 If then else语句 脚本中动作 菜单 条件控制语句 If then els ...
- GDB-Darwin-Extentions
- iOS多线程的初步研究
iOS多线程的初步研究(四) 理解run loop后,才能彻底理解NSTimer的实现原理,也就是说NSTimer实际上依赖run loop实现的. 先看看NSTimer的两个常用方法: + (NST ...
- 绘制基本图形和线型(StrokeStyle)的设置详解
绘制基本图形和线型(StrokeStyle)的设置详解 目前,在博客园上,相对写得比较好的两个关于Direct2D的教程系列,分别是万一的Direct2D系列和zdd的Direct2D系列.有兴趣的网 ...
- 纯Python综合图像处理小工具(2)图像增强
<背景> 这次分享的脚本是对图像进行增强处理,包含对图像像素的色彩增强.亮度增强.对比度增强.图像尖锐化等增强操作,主要基于PIL包的lambda和ImageEnhance模块. 使用方法 ...
- eclipse debug 多线程
以前用到过许多线程开发,对多线程开发也算是小有点心得,但一开始多线程开发的时候,碰到很多壁.但总得来说,有个好的工具总是能事半功倍.我用的工具是eclipse,在开发多线程时,其debug模式是能直接 ...
- 【汇编】字符串处理指令 stosb、lodsb、movsw、scasb、rep
一.字符串处理指令 (1) lodsb.lodsw:把DS:SI指向的存储单元中的数据装入AL或AX,然后根据DF标志增减SI (2) stosb.stosw:把AL或AX中的数据装入ES:DI指向的 ...