Changes between Version 4 and Version 5 of const
- Timestamp:
- May 13, 2010, 4:57:49 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
const
v4 v5 4 4 5 5 ||`const int x;`[[br]]`int const x;`||The value of the `int` cannot be changed.|| 6 ||`const int *p;`[[br]]`int const *p;`||The value of the `int` cannot be changed through this pointer .||7 ||`int *const p;`||The value of the pointer cannot be changed.||8 ||`const int *const p;`||The value of the pointer cannot be changed, and the value of the `int` cannot be changed through this pointer.||6 ||`const int *p;`[[br]]`int const *p;`||The value of the `int` cannot be changed through this pointer (`*p = n` is disallowed).|| 7 ||`int *const p;`||The pointer cannot be repointed (`p = q` is disallowed).|| 8 ||`const int *const p;`||The pointer cannot be repointed, and the value of the `int` cannot be changed through this pointer.|| 9 9 ||`const int a[3];`||The values of the `int`s in the array cannot be changed.|| 10 10 ||`const char **pp;`||The `char` pointed to by `*pp` cannot be changed through it.|| 11 ||`char *const *pp;`||The `char *` pointed to by `pp` cannot be changed through it.||12 ||`char **const pp;`||`pp` cannot be changed.||13 ||`const char *const *pp;`||The `c har *` cannot be changed through `pp`, and the `char` cannot be changed through `*pp`.||11 ||`char *const *pp;`||The `char *` pointed to by `pp` cannot be repointed through it.|| 12 ||`char **const pp;`||`pp` cannot be repointed.|| 13 ||`const char *const *pp;`||The `const char *` cannot be repointed through `pp`, and the `char` cannot be changed through `*pp`.|| 14 14 ||`const char *const *const pp;`||All of the above.|| 15 15