The application scene of C++ const pointer
In C++ code, there is a class named Base. The const Base *p1 pointer cannot call the set method, but can call the get method. However, the get method must be declared as const. We can use it as a data receiver, and because of the existence of const, the Read more…