C++編程風格1——頭文件

一、防文件重複包含linux 方法1:Window平臺下,有專門的命令#pragma once防止頭文件重複包含編程 方法2:函數 #ifndef XXX_H//通用的的防頭文件重複的命令,如test.h能夠寫成TEST_H #define XXX_H工具 ……google #endifspa 二、前置聲明(forward declarations)指針 使用前置聲明儘可能減小.h文件中#incl
相關文章
相關標籤/搜索