////
In ANSI C, the const modifier is globally visible, such as a const variable in a header file
C + + defaults all const adornments to static
////
The C-language bool was added after C99.
const char *p = ""; P is point to const char
*p is char;
const modifier char;
char Const *P = ""; P is point ro char const
*p is char const;
char * const p; Const P is point to char;; ((*P) (* const P))
* (const p) is char;
Bjarne a mnemonic method in his C + + programming language:
Read a statement from right to left.
char * const CP; (* read into pointer to) CP was a const pointer to Char
const char * p; P is a pointer to const char;
Char const * p; Ibid. because there are no const* operators in C + +, const can only belong to the preceding type.
The C + + standard stipulates that the Const keyword is placed before the type or variable name is equivalent.
Order
Base class constructs a member construction construct
Analysis of constitutive basis of constituent members
Strange.
void &a = 0; Err
Double &r = 0; Ok? I tried not to be OK.
int *p; int * &RP = P;RP = reference OK for a;//pointer
int a[1]; int & Ra[10] = a;//No reference to the array
No referenced reference, no reference pointer;
int & Rs[1] = A; Err
////
Reserved words do not necessarily appear in the syntax.
////
(++i) + (++J)
The calculation of this expression has two side-effects:
I self-increment 1;
J self-increment 1;
But which one happens first? The answer is: any answer is wrong.
////
For example, the following expression, as specified by the standard, does not define the result:
(i++) + (i++)
A summary of a book