1.Char * B = const char * A will report a warning, while const char * A = char * B will notTo make the assignment form legal, one of the following conditions must be met:
1) both operands are pointers to compatible types with or without delimiters.
2) The type pointed to by the Left pointer must have all the qualifiers of the type pointed to by the right pointer.
Warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
(C expert programming: section 1.9)
2.Examples and solutions for converting a signed number to an unsigned number
Let's look at a piece of code:
IntMain (){Int d =-1; UnsignedInt A =3;If (d <A) {printf ("D is low \ n");}}
This Code does not respond after running, indicating that the program does not enter the if judgment statement, that is, the return value of if judgment is always 0.
The reason is obvious, because the conversion of D to an unsigned integer will become very large, which will always be greater than,
The solution is:
If (d <(Int ))
(C Programming expert: section 1.10)
C expert programming --- unknown things