#error和line
#error message ----注:message不需要用双引号包围,
#error 编译指示字用于自定义程序特有的编译错误消息类似的,
#warning用于生成编译警告,但不会停止编译。
在linux终端定义 gcc -Dadroid40 test.c ---在终端定义常量方法,后执行a.out,结果正常输出,
定义宏常量:gcc -DCOMMAND=\"Test\" error.c -o error---注:定义一个宏常量 --- “字符串”。
在代码里定义 定义宏常量:#define COMMAND “Test”
#line的用法:
#line 用于强制定新的行号和编译文件名,并对源程序的代码重新编号,
用法:#line number filename 注:filename可省略,
#line 编译指示字的本质是重定义_line_和_FILE_
#include<stdio.h>
#define CONST_NAME1 "TEST"
#defineCONST_NAME2 "Test"
void f();
int main ()
{
printf("%s\n",CONST_NAME1);
printf("%s\n",CONST_NAME2);
printf("%s\n",_LINE_);
printf("%s\n",_FILE_);
f();
return 0;
}
#line 1 “dingpeifei”
void f()
{a+b; }
#line 用于程序员找错误,有错误代码会有提示:从#line 1“dingpeifei”下一行开始计数,容易找到错误代码;
#error和line的更多相关文章
- Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
启动tomcat, 出现, ( 之前都是好好的... ) [lk ] ERROR [08-12 15:10:02] [main] org.springframework.web.context.Con ...
- 关于xml加载提示: Error on line 1 of document : 前言中不允许有内容
我是在java中做的相关测试, 首先粘贴下报错: 读取xml配置文件:xmls\property.xml org.dom4j.DocumentException: Error on line 1 of ...
- error on line 1 at column 6: XML declaration allowed only at the start of the document
This page contains the following errors: error on line 1 at column 6: XML declaration allowed only a ...
- "fatal: protocol error: bad line length character: No This"
git clone 远程地址时候出现 "fatal: protocol error: bad line length character: No This" 错误 在stackov ...
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...
- (转)Windows 平台下解决httpd.exe: syntax error on line 39
近来在研究PHP,结果为了Apache的安装伤神不已...小白我在安装后,启动Apache的服务虽然可以,不过,在Apache sevice monitor 中启动services时就会出现如下的问题 ...
- fatal: protocol error: bad line length character: This
昨晚尝试搭建一个Git服务器,在搭建好服务器后,在服务器创建了一个空项目,我在本地使用git clone 拉取项目时,报了fatal: protocol error: bad line length ...
- MySQL数据库导入错误:ERROR 1064 (42000) 和 ERROR at line xx: Unknown command '\Z'.
使用mysqldump命令导出数据: D:\Program Files\MySQL\MySQL Server 5.6\bin>mysqldump -hlocalhost -uroot -proo ...
- Java使用dom4j读取xml时报错:org.dom4j.DocumentException: Error on line 2 of document : Invalid byte 2 of 2-byte UTF-8 sequence. Nested exception: Invalid byte 2 of 2-byte UTF-8 sequence
1.Java使用dom4j读取xml时报错: org.dom4j.DocumentException: Error on line 2 of document : Invalid byte 2 of ...
- Jmeter BeanShell 引用变量报错jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval Parse error at line 14, column 181 : Error or number too big for integer
如果你通过CSV Data Set Config或者_StringFromFile函数来参数化你的请求,需要特别注意当参数为纯数字时,jmeter会默认将其识别成int型数据,说明jmeter并不是默 ...
随机推荐
- C#通过“委托和事件”的方式实现进程监控并与“普通方式”对比
今天重新学习了一下观察者模式,对我的思路产生了启发.进程监控程序之前写过几个,这回换一种思路,改用委托和事件来实现.我已经用序号将关键的几步标注,方便大家理顺思路.代码如下: using System ...
- R ggplot2 线性回归
摘自 http://f.dataguru.cn/thread-278300-1-1.html library(ggplot2) x=1:10y=rnorm(10)a=data.frame(x= x, ...
- DHCP配置实例
配置DHCP的思路: 1.创建dhcp服务2.添加一个网络号(或者说地址池)3.排除路由器的网管4.排除DHCP的网关 代码: Router>enableRouter#configRouter# ...
- 来自阿里的 json 解析方案 fastjson
说起Json 解析,有非常多方法,不管是出自Google 的Gson也好,还是来自其它的某某.想必大家都非常熟悉. 今日在github上闲逛.偶遇 一 json 解析库.看起来非常不错,据说是眼下最快 ...
- mybatis深入学习
最近做的一个活可以让我深入学习一下现在比较流行的ORM框架:mybatis/ibatis的内部原理,SQL的拦截,解析,dataSource和JDBC中做一些额外的事情.如果有可能的话想造一个比较简单 ...
- USB 驱动之 usb_register 函数解析
前段时间在kernel 添加了 USB to LAN 模块 AX88772B 的驱动. 根据相关添加解析一下 usb_register_driver 函数 drivers/net/usb/asix.c ...
- Spring Boot 更换 Banner
Spring 启动时,会有一个Banner图案,这个图案是可以更换的 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ ...
- 【Qt Tips】QLineEdit内容过滤之setValidator和setInputMask浅析
1.QValidator分析 2.InputMask格式 3.测试代码和用例 项目路径: GitHub: https://github.com/Qunero/NeoQtTestDemo/tree/ma ...
- kill 信号大全
linux kill信号列表$ kill -l1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL5) SIGTRAP 6) S ...
- 浅谈 JavaScript 编程语言的编码规范
对于熟悉 C/C++ 或 Java 语言的工程师来说,JavaScript 显得灵活,简单易懂,对代码的格式的要求也相对松散.很容易学习,并运用到自己的代码中.也正因为这样,JavaScript 的编 ...