Summary summary for the C ++ Const pointer definition

xiaoxiao2021-03-06  65

int main ()

{

/ * 1. Look at a definition, read from the identifier, read * (pointer),

That is, the type of pointer we want to define.

2. * (Pointer) The entire left side of the pointer is the type referred to. * /

Const int Ci = 10;

Const Int * CIP = & Ci;

// According to the above method analysis, the CIP is a pointer, this pointer points to a const Int type

// further: int Const * ICP = & Ci; also a definition method of the same efficiency.

// According to my understanding, I prefer the former one, he is more reasonable.

Const Int * Const CiPC = & Ci;

/ / Similarly, from the CIPC read, the CIPC is a const pointer to point to a const Int type.

// int const * const icpc = & chi; is also an equivalent definition

}

转载请注明原文地址:https://www.9cbs.com/read-89165.html

New Post(0)