简体   繁体   中英

Initializing pointer to pointer to const float etc. using new operator

Consider the following declarations :

const float** b;
const float* const* c;
float* const* d;

First off all I want to make sure that :

  • b is a pointer to pointer to const float .

  • c is a pointer to const pointer to const float .

  • d is a pointer to a const pointer to float .

Now my question is how can I initialize each pointer using new operator ?

const float** b = new const float*();
const float* const* c = new const float*(nullptr);
float* const* d = new float*(nullptr);

the type with one less indirection and set values if they point on const

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM