1. From the simplest of words:
First, the conversion between an int variable and a char variable is divided into implicit conversion and display transformation.
For example: int i; char c; i = C;
The implicit conversion, the compiler implicitly converts a char variable into an int type.
For example: int i; char c; i = (int) c;
The conversion is displayed very much, indicating the type to be converted.
Whether a display conversion or an implicit conversion is risky, there is a risk that a large memory model (such as int) can be converted to a small memory model (such as Char) with truncation.
However, the transition from a small memory model to a large memory model is a high-level complement (a positive complement of 0, a negative complement of 1).
2. Type conversion of pointers
For example: a = 1;int *p = &a;float *PF = (float*) p;
The values of P and pf are all &a, but *p is interpreted by the value in the &a address as an int variable, and *p1 is interpreted as a value in the &a address according to the float variable.
Example: int a;float *p;p = &a;
The compiler will make an error and the pointer type does not match. Note that a certain type of conversion can be made between pointers, but pointers have a specific type, and you cannot assign a pointer of one type to a pointer of another type, unless you add a cast.
For example: int a;float *p;p = (float*) &a;
This is possible.
Problems with type conversion in C + +