Home > OS >  What is the meaning of c # in line with the answer
What is the meaning of c # in line with the answer

Time:10-05

//test. The c
#include
#include
Int main ()
{
# line 90 "digitmap. Y"
Printf (" the current line number % d, the current file % s \ n ", __LINE__, __FILE__);
return 0;
}
C
cc test../a.out
The results for the current line number 90, the current file digitmap. Y

If the comment out//# line 90 "digitmap. Y
"The results for the
./a.out
The current line number 6, the current file test. C

# line 90 "digitmap. Y" actually means that the meaning of macro substitution, will __LINE__ __FILE__ replace # lilne respectively after the line number and the name of the file

CodePudding user response:

Usually in the preprocessor
For example, CPP, esqlc, proc

CodePudding user response:

# line is used to specify the new line number, and compile the file name,

After the line number, starting from # line number of the definition of the line, as counted (understand this sentence, the configuration code)
 
#include
Int main ()
{

C # the line 20 "XXX."
Printf (" % d \ n ", __LINE__);

Printf (" % d \ n ", __LINE__);
return 0;
}


The above code output:
20
22
  • Related