How to optimize C++ registers
This article mainly explains "how to optimize C++ registers". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to optimize C++ registers"!
C++ register optimization
There is an interesting phenomenon in C++. Look at the code first.
# include
Using namespace std
Int main ()
{
Int const tmp = 100; / / definition constant tmp tmp cannot be modified
Int const* p = & tmp; / / the pointing value cannot be modified through the pointer
Int* const Q = const_cast (p); / / the unconstant attribute can modify the content of the point through the pointer
* Q = 200
Cout