const 無處不在!

在C++的函數定義中,處處都是const關鍵字的使用 1.const修飾普通變量 2.const修飾指針 3.const修飾函數參數 4.const修飾函數返回值 5.const在類中的使用 For example,下面這段代碼將const的各類應用場景都糅雜到了一塊兒: #includeweb using namespace std;svg /* * const修飾函數參數 * * const
相關文章
相關標籤/搜索