Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在编译那段代码时在编译时显示的代码中嵌入一条消息?这些消息本质上是诊断性的,不应修改或中止编译过程。
(免责声明:我知道这个问题的答案。我没有在 Stack Overflow 上找到它,我认为这将是对知识库的有用补充。)
这是一种方法:
#pragma message("Your Message Here")
https://msdn.microsoft.com/en-us/library/x7dkzch2.aspx