---static_cast Static type conversions
---static: compile-time
---Type conversions: conversion between normal types, void* and normal type pointers, inter-pointer conversions with inheritance (richer than dynamic type conversions)
---normal type conversions:
int a = 10; int b = 3; Requirements: float c = A/b = 3.333
1.a Change to float type
2.
3.
---conversion between void* and normal type pointers:
And I know it now. float* this type, the printed result is estimated that you can't imagine.
---transition between pointers with inheritance
There's no dynamic_cast so strict here.
1.p1 position is paired with b* position, otherwise the compilation does not pass
2. Just a pointer to the parent class--A parent class--a subclass pointer or a pointer to a subclass--subclass--the pointer to the parent class is true
3.P1 and P2 must have a new, otherwise
4. Careful use, low portability
5. Can replace dynamic_cast at a certain time
--const_cast:const pointer conversion to non-const pointer
--reinterpret_cast: This can be said to be a lawless compiler, between pointers, numbers and types of random strong, cheat the compiler, but the call is wrong or wrong
Promotion of C + + static_cast