#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的更多相关文章

  1. 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 ...

  2. 关于xml加载提示: Error on line 1 of document : 前言中不允许有内容

    我是在java中做的相关测试, 首先粘贴下报错: 读取xml配置文件:xmls\property.xml org.dom4j.DocumentException: Error on line 1 of ...

  3. 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 ...

  4. "fatal: protocol error: bad line length character: No This"

    git clone 远程地址时候出现 "fatal: protocol error: bad line length character: No This" 错误 在stackov ...

  5. Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止

    1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...

  6. (转)Windows 平台下解决httpd.exe: syntax error on line 39

    近来在研究PHP,结果为了Apache的安装伤神不已...小白我在安装后,启动Apache的服务虽然可以,不过,在Apache sevice monitor 中启动services时就会出现如下的问题 ...

  7. fatal: protocol error: bad line length character: This

    昨晚尝试搭建一个Git服务器,在搭建好服务器后,在服务器创建了一个空项目,我在本地使用git clone 拉取项目时,报了fatal: protocol error: bad line length ...

  8. 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 ...

  9. 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 ...

  10. 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并不是默 ...

随机推荐

  1. Ubuntu 16.04和win10双系统时间不一致解决办法

    windows10和ubuntu16.04双系统,装完后,在windows下时间不对,之前的老办法是: sudo gedit /etc/default/rcS 2 utc=yes 改成utc=no 然 ...

  2. webRTC结合canvas截图

    直接看代码.css基础弱鸡,将就看吧.慢慢学习 <!DOCTYPE html> <html> <head> <meta charset="utf-8 ...

  3. word公式编辑器公式

    Linear format equations and Math AutoCorrect in Word Applies To: Word 2016 Outlook 2016 Word 2013 Ou ...

  4. JDK1.6.0+Tomcat6.0的安装配置

    JDK1.6.0+Tomcat6.0的安装配置是如何进行的呢?我们按照下面几个步骤来: 1.安装JDK 这是进行JSP开发的重要一步,也是安装JSP引擎(Tomcat.Resin.Weblogic等) ...

  5. contiki list 链表

    1 相关宏和数据结构 1.1 LIST_CONCAT #define LIST_CONCAT2(s1, s2) s1##s2 #define LIST_CONCAT(s1, s2) LIST_CONC ...

  6. 4G模块ME3760_V2的拨号过程

    AT AT+CFUN=1                          模块功能全打开,上电可以设置默认状态 AT+ZSET="LET_INFO" 掉电后可以保存AT+CFUN ...

  7. flume采集启动报错,权限不够

    18/04/18 16:47:12 WARN source.EventReader: Could not find file: /home/hadoop/king/flume/103104/data/ ...

  8. ip辅助和别名的区别

    更流畅 IP 别名和辅助 IP 地址 2017-01-25 12:05             838人阅读             评论(0)             收藏              ...

  9. JavaScript 关键字快速匹配

    来源: http://www.cnblogs.com/index-html/archive/2013/04/17/js_keyword_match.html http://www.etherdream ...

  10. 在使用R做数据挖掘时,最常用的数据结构莫过于dataframe了,下面列出几种常见的dataframe的操作方法

    原网址 http://blog.sina.com.cn/s/blog_6bb07f83010152z0.html 在使用R做数据挖掘时,最常用的数据结构莫过于dataframe了,下面列出几种常见的d ...