/** read-only variables and constants const READ-only const int A;int const a;//are equivalent to the above line of code, all representing a constant shape number. int *const A;//const has a "left associative", that is, a const modifier *, then, it is not difficult to understand that the sentence represents a constant pointer to an integer, a pointer to an integer can be modified, but pointer a cannot be modified. The const int *a;//is equivalent to the following line, which, according to the "left associative" nature, is the const modifier (*a), which is an integer, so the two sentences indicate that the pointer points to a constant integer. The int const *a;int Const *A const;//is based on the "left associative" nature, the first const modifier (*), and the second const modifier (a), so that this sentence represents a constant pointer to a constant integer. **/#include <stdio.h> #define PI 3.145926145926int Main (void) {const int a = 10;//cannot modify constant constant, invariant int const B = 2.3e2;// Can not modify the equivalent of the above 2*10 2 times E to 10 as the base of the power//may modify the variable with the pointer//int *p = &a;//pointer can be changed//*P = 55;//printf ("%07.3f\n", PI); The value retains 3 decimal places, including a total of 7 decimal places; 0//int c = sizeof (float); int float long takes 4 bytes 32 bits char c = ' a '; A character or letter occupies 1 bytes 8 bits The smallest is 1-255//c = sizeof (c);p rintf ("%d", c),//97 output is ASCII 01100010 is a means that the characters are also binary access return 0;}
One character in the C language corresponds to an ASCII code, a 1-byte 8 bits, and a binary representation of ASCII decimal in memory.