C++ ‘__FILE__’ and ‘__LINE__

Q: What are '__FILE__' and '__LINE__'?

A: '__FILE__' and '__LINE__' are predefined macros and part of the C/C++ standard. During preprocessing, they are replaced respectively by a constant string holding the current file name and by a integer representing the current line number.

There are other preprocessor variables including:
'__DATE__' -> a string literal of the form "Mmm dd yyyy"

'__TIME__' -> a string literal of the form "hh:mm:ss"

'__TIMESTAMP__' -> a string literal of the form "Mmm dd yyyy hh:mm:ss"

'__FUNCTION__' -> a string literal which contains the function name (this is part of C99, the new C standard and not all C++ compilers support it)
 

原文链接: https://www.cnblogs.com/lancidie/archive/2013/04/17/3027024.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    C++ '__FILE__' and '__LINE__

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/85005

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月9日 下午9:50
下一篇 2023年2月9日 下午9:50

相关推荐