摘要: constexpr 类型变量必须用常量表达式或 constexpr 函数来初始化: constexpr int a=10; constexpr int b=a+10; constexpr int c=d(); //当 d()为一个 constexpr 函数时才可以 constexpr 函数的形参和返 阅读全文
posted @ 2019-02-26 19:05 我是好人007 阅读(1313) 评论(0) 推荐(0) 编辑
摘要: 常量指针为顶层 const,即把 * 放在 const 关键字之前。 例如: int a=0; int *const pa=&a; // pa 为常量指针 一直指向a 指针指向的是一个常量为底层 const,* 放在 const 之后。 例如: const int b=0; const int *p 阅读全文
posted @ 2019-02-26 18:52 我是好人007 阅读(163) 评论(0) 推荐(0) 编辑