/* 指向double类型的,定义成const对象的指针 */ const double *pc = 0; const double minWage = 9.60; pc = &minWage; /* 指向int类型的const指针 */ int errNumb = 0; int *const curErr = &errNumb; /* 指向double类型的,定义成const对象的const指针 */ const double pi = 3.14159; const double *const pi_ptr = π
using namespace std; const int ival = 1024; const int *const &pi_ref = &ival; int _tmain(int argc, _TCHAR* argv[]) { return 0; }
const int *&pi_ref = &ival;
const T &pi_ref = &ival;
T temp; temp = &ival; const T &pi_ref = temp;
T temp; temp = &ival; T const &pi_ref = temp;
因篇幅问题不能全部显示,请点此查看更多更全内容