matlab line指令
The #line is a preprocessor directive in C programming language; it is used to reset the line number in the code. We can reset line number from any line in the code.
#line是C编程语言中的预处理程序指令; 它用于重置代码中的行号。 我们可以从代码中的任何行重置行号。
Example:
例:
#include <stdio.h> /*line 1*/
/*line 2*/
int main(){ /*line 3*/
/*line 4*/
printf("Hello world\n"); /*line 5*/
//print current line /*line 6*/
printf("Line: %d\n",__LINE__); /*line 7*/
//reset the line number by 36 /*line 8*/
#line 36 /*reseting*/
//print current line /*line 36*/
printf("Line: %d\n",__LINE__); /*line 37*/
printf("Bye bye!!!\n"); /*line 39*/
/*line 40*/
return 0; /*line 41*/
} /*line 42*/
Output
输出量
Hello world
Line: 7
Line: 37
Bye bye!!!
翻译自: https://www.includehelp.com/c-programs/line-directive-example-in-c.aspx
matlab line指令