10-11-2014, 03:27 PM
The third and last example of Rule 11.3 states that
I do not understand why the example is non-compliant, as the cast only adds a const-qualifier and leaves the base type as it is (i.e. "int").
Could you please explain this a little further?
Code:
int * const * pcpi;
const int * const * pcpci;
pcpci = ( const int * const * ) pcpi;
Quote:is non-compliant because the unqualified pointer types are different, namely “pointer to const-qualified int†and “pointer to intâ€But the rule's amplification explicitly states, that
Quote:This rule applies to the unqualified types that are pointed to by the pointers.and that the rule's goal is to prevent misalignment.
I do not understand why the example is non-compliant, as the cast only adds a const-qualifier and leaves the base type as it is (i.e. "int").
Could you please explain this a little further?
<t></t>