#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. OpenLdap 相关命令

    相关命令: |-slapd 目录服务的主要程序|-slurpd 目录服务进行复制的程序|-slapadd 向目录中添加数据|-slapcat 把目录中的条目导出成ldif文件|-slapindex 重 ...

  2. Clipboard获取内容C#

    一.获取文本  textBox1.Text = Clipboard.GetData("Text").ToString(); 二.获取图像             pictureBo ...

  3. 【C#/WPF】用Thumb做可拖拽的UI控件

    需求:简单的可拖拽的图片 使用System.Windows.Controls.Primitives.Thumb类 前台: <Canvas x:Name="g"> < ...

  4. 3D跑马灯效果

    睡了13个小时,发烧终于退了,持续2周的感冒看起来终于好了点,这一周一直在看perspective的一些资料,写一个3D跑马灯的效果. 个人感觉主要就是理解视角的概念,也就是perspective和p ...

  5. Object中有哪些方法?

    有一种遗憾就是,每天都见到你,但是却不关注你!等到面试的时候才后悔莫及. Object类中有9大public方法: equals:判断两个对象"相等" hashCode:获取对象的 ...

  6. Postgres数据库备份与还原命令

    备份 pg_dump.exe -c -b -E UTF8 -U postgres -h 127.0.0.1 -p 5432 -f "f:\testdb001.bak" testdb ...

  7. FusionCharts JavaScript API Column 3D Chart

    Column 3D Chart labelDisplay  label显示的方式 设置为AUTO 可以根据密度自动排列 slantLabels 0/1  与labelDisplay配合使用 如果lab ...

  8. Zend Studio 配置

    2.更改Zend字体 依次进入Window——Preferences——General——Appearance——Colors and Fonts——Basic——Text Font进行修改,偶还是喜 ...

  9. 怎样使用 RMAN 增量备份恢复 data guard log gap(日志断档)

    主库查询最小scn 信息: SQL> col current_scn for 999999999999999 SQL>  SELECT CURRENT_SCN FROM V$DATABAS ...

  10. 服务器不装Excel读取Excel并转换DataTable

    原来是用OleDb.4.0组件读取Excel,但是放到服务器后 傻了,服务器没装Excel ,而且领导说不可以装 没办法,只好自己重新找下代码 在CodeProject找到一个开源的dll,一阵欢喜啊 ...