[英]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
. b
是pointer
const float
pointer
。
c
is a pointer
to const pointer
to const float
. c
是pointer
const float
const pointer
。
d
is a pointer
to a const pointer
to float
. d
是一个pointer
到一个const pointer
到float
。
Now my question is how can I initialize each pointer using new operator
? 现在我的问题是如何使用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 如果指向const,则只有少一个间接的类型和设置值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.