What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
cs:programming:cpp:cpp_primer:2_var_n_types [2024/04/16 02:52] – [指向指针的指针] codingharecs:programming:cpp:cpp_primer:2_var_n_types [2024/04/16 11:38] (当前版本) – [指针与 constexpr] codinghare
行 309: 行 309:
 int **ppi = π //&pi is the address of the pointer, not the address which pointer points int **ppi = π //&pi is the address of the pointer, not the address which pointer points
 </code> </code>
-// // +\\ \\ 
 {{ :cs:programming:cpp:cpp_primer:ppi.svg?250 |}} {{ :cs:programming:cpp:cpp_primer:ppi.svg?250 |}}
-// // +\\ \\  
 当然,如果需要通过 ''ppi'' 来访问 ''i'' 的内容,我们需要解引用两次: 当然,如果需要通过 ''ppi'' 来访问 ''i'' 的内容,我们需要解引用两次:
 <code cpp> <code cpp>
行 559: 行 560:
 ''const int *const p'' 这样的形式换成 constexpr 来定义可以写成这样: ''const int *const p'' 这样的形式换成 constexpr 来定义可以写成这样:
 <code cpp> <code cpp>
-constexpr const int *p = &i; //是不是清爽多了哈哈+constexpr const int *p = &i;
 </code> </code>
 Ref:[[http://www.cprogramming.com/c++11/c++11-compile-time-processing-with-constexpr.html|Constexpr - Generalized Constant Expressions in C++11]] Ref:[[http://www.cprogramming.com/c++11/c++11-compile-time-processing-with-constexpr.html|Constexpr - Generalized Constant Expressions in C++11]]