#line伪指令
#include<stdio.h>
#line 4 "junk.c"
void main()
{
printf("in line %ds",_ _LINE_ _,_ _FIL_ _);
#line 12"temp.c"
printf("\n");
printf("in line %ds",_ _LINE_ _,_ _FIL_ _);
#line 8
printf("\n");
printf("in line %ds",_ _LINE_ _,_ _FIL_ _);
}
我的问题是:
1、这个程序在VC6.0下没有运行成功
报错为:
--------------------Configuration: temp - Win32 Debug--------------------
Compiling...
123.cpp
junk.c(6) : error C2065: '_' : undeclared identifier
junk.c(6) : error C2146: syntax error : missing ')' before identifier '_LINE_'
junk.c(6) : error C2059: syntax error : ')'
temp.c(13) : error C2146: syntax error : missing ')' before identifier '_LINE_'
temp.c(13) : error C2059: syntax error : ')'
temp.c(9) : error C2146: syntax error : missing ')' before identifier '_LINE_'
temp.c(9) : error C2059: syntax error : ')'
执行 cl.exe 时出错.
2、能否解释一下这个程序的作用?
书上的解释是:编译有错或者在交叉引用时,希望使用原来的文件名和原来的行号,则应事先在源文件中使用#line伪指令加以登记。