【c++11】const與constexpr

const你們都知道,當咱們但願定義一種變量,它的值不能被改變時使用。html 一 初始化時注意幾點c++ 1.定義時必須初始化函數 const int i = 42;//correct const int k;//wrong,const should be initialized 2.能夠用很是量初始化指針 int i = 42; const int j = i;//正確,拷貝完成後j的值與i沒
相關文章
相關標籤/搜索