您的位置:首页 > 编程语言 > C语言/C++

C++ '__FILE__' and '__LINE__

2011-07-28 15:24 369 查看
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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐