1
double rates[5] = {1, 2, 3, 4, 5};
const double * pd = rates;
- 被
pd
指向的值不可改变,比如,不允许*pd = 20
- 但是
pd
的指向改变,比如,允许pd++
2
double rates[5] = {1, 2, 3, 4, 5};
const double * const pc = rates;
- 此时
pd
的指向也不能改变了
double rates[5] = {1, 2, 3, 4, 5};
const double * pd = rates;
pd
指向的值不可改变,比如,不允许*pd = 20
pd
的指向改变,比如,允许pd++
double rates[5] = {1, 2, 3, 4, 5};
const double * const pc = rates;
pd
的指向也不能改变了