It tells the compiler that next line of source code is at the line number which has been specified by constant in #line directive i.e it transfer the program control to the line number which has been specified by #line directive.
Example:
#include<stdio.h>
#line 15
int main(){
int a=10;
a++;
a++;
#line 5
printf("%d",a);
}
If we will see its intermediate file then before the actual compilation the source code is expanded as :
In the very long c program for debugging purpose if we want to check the program after the line 300 by F7 key then we will write #line 20
2 comments:
how to see the intermediate file
In command prompt write: CPP fileName.c
Post a Comment