程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C++ >> C++入門知識 >> C++ __FILE__ and __LINE__

C++ __FILE__ and __LINE__

編輯:C++入門知識

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)
 


摘自 roger0705sally的專欄 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved