in above line both the pointer and the values are const so how to initialize it?Code:int const * const cpi;
in above line both the pointer and the values are const so how to initialize it?Code:int const * const cpi;
The same way you would initialise a const reference, e.g.,
Actually, if I did not need to use a pointer that is const, I would use a reference.Code:int const x = 100; int const * const p = &x;
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)