Use the C preprocessor macros
__FILE__ (which expands to the name of the current input file, in the form of a C string constant; this is the path by which the preprocessor opened the file) and
__LINE__ (which expands to the current input line number, in the form of a decimal integer constant).
© M. Vallisneri 2012 — last modified on 2010/01/29
Tantum in modicis, quantum in maximis