使得头文件安全的通用做法,是使用预处理器定义头文件保护符。
A common way to make headers safe USES the preprocessor to define a header guard.
头文件保护符用于避免在已经见到头文件的情况下重新处理该头文件的内容。
The guard is used to avoid reprocessing the contents of a header file if the header has already been seen.
头文件应该含有保护符,即使这些头文件不会被其他头文件包含。
Headers should have guards, even if they aren't included by another header.
头文件应该含有保护符,即使这些头文件不会被其他头文件包含。
Headers should have guards, even if they aren't included by another header.
应用推荐