__FILE__,__LINE__

简介:

编译器内置宏:

先介绍几个编译器内置的宏定义,这些宏定义不仅可以帮助我们完成跨平台的源码编写,灵活使用也可以巧妙地帮我们输出非常有用的调试信息。

ANSI C标准中有几个标准预定义宏(也是常用的):

__LINE__:在源代码中插入当前源代码行号;

__FILE__:在源文件中插入当前源文件名;

__DATE__:在源文件中插入当前的编译日期

__TIME__:在源文件中插入当前编译时间;

__STDC__:当要求程序严格遵循ANSI C标准时该标识被赋值为1;

__FUNCTION__:在源文件中插入当前函数名;

__cplusplus:当编写C++程序时该标识符被定义。

编译器在进行源码编译的时候,会自动将这些宏替换为相应内容。




本文转自 Linux_woniu 51CTO博客,原文链接:http://blog.51cto.com/linuxcgi/1965336
相关文章
|
2月前
|
数据库 Python
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
Traceback(most recent call last):File "main.py", line 4l,in<module>alueError: sleep length must be n
InvalidJobConfException: Output directory not set
InvalidJobConfException: Output directory not set
58 0
|
编译器 C语言
__FILE__, __LINE__ __FUNCTION__
__FILE__, __LINE__ __FUNCTION__
|
Java
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
解决Command line is too long. Shorten command line for ServiceStarter or also for Application报错
363 0
Newline required at end of file but not found.
Newline required at end of file but not found.
176 0
Newline required at end of file but not found.
FILE
FILE
115 0
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Can‘t read file : End of file found 文件:txn_current、current svn无法正常读取文件
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
找到你项目中 .idea/workspace.xml文件 找到 < component name=“PropertiesComponent” > 在标签内部加上这句
166 0
Command line is too long. Shorten command line for AppWebStarter or...(已解决)
OSError: image file is truncated (12 bytes not processed) Premature end of JPEG file
OSError: image file is truncated (12 bytes not processed) Premature end of JPEG file
500 0