Click to See Complete Forum and Search --> : What is the function of __FILE__ and __LINE__?


George2
January 22nd, 2003, 02:24 AM
Hi, everyone!

What is the meaning of __FILE__ and __LINE__ in the following code?

sprintf (s, "_Assert: %s, %d",__FILE__, __LINE__ )

Another question, where is the two variable defined?
Are they compile system variable?

Thanks in advance.
George

galathaea
January 22nd, 2003, 03:46 AM
They are preprocessor defined variables (and a part of the c++ standard) that mean exactly what they say. They transform after preprocessing to the line integer and the file name string. They are useful in debugging (which is what the sprintf is doing).

George2
January 22nd, 2003, 04:33 AM
Thanks!

George
Originally posted by galathaea
They are preprocessor defined variables (and a part of the c++ standard) that mean exactly what they say. They transform after preprocessing to the line integer and the file name string. They are useful in debugging (which is what the sprintf is doing).