c语言__line__
The __LINE__ is an inbuilt Macro in C programming language, it returns current line number of the code.
__LINE__是C语言的内置宏,它返回代码的当前行号。
Example:
例:
#include <stdio.h>
int main(){
printf("Hello world\n");
printf("Line: %d\n",__LINE__);
printf("How are you?\n");
printf("Line: %d\n",__LINE__);
printf("Bye bye!!!\n");
return 0;
}
Output
输出量
Hello world
Line: 6
How are you?
Line: 8
Bye bye!!!
翻译自: https://www.includehelp.com/c-programs/__LINE__macro-example-in-c.aspx
c语言__line__