Changes between Version 7 and Version 8 of const
- Timestamp:
- May 13, 2010, 5:38:04 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
const
v7 v8 20 20 However, it is safe to convert `foo **` to `const foo *const *`. C++ lets you do this implicitly (conv.qual 4 in the standard); for no particular reason, C does not. 21 21 22 In C, `void *` may be implicitly converted to and from `foo *`, and hence also to `const foo *`. `const void *` may be implicitly converted to and from `const foo *`, and hence also from `foo *`.22 `foo *` may be implicitly converted to `void *`, hence also to `const void *`, but `const foo *` may only be converted to `const void *`. In C (but not C++), `void *` may be converted to `foo *`, hence also to `const foo *`, but `const void *` may only be converted to `const foo *`. 23 23 24 24 == How `const` relates to `malloc` and `free` ==