About GBdirect Consultancy Training Development

Section navigation

Leeds Office (National HQ)

GBdirect Ltd
Leeds Innovation Centre
103 Clarendon Road
LEEDS
LS2 9DF
West Yorkshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

South East Regional Office

GBdirect Ltd
18 Lynn Rd
ELY
CB6 1DA
Cambridgeshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

Please note: Initial enquiries should always be directed to our UK national office in Leeds (West Yorkshire), even if the enquiry concerns services delivered in London or South/East England. Clients in London and the South East will typically be handled by staff working in the London or Cambridge areas.

6.6. Qualifiers and derived types

Arrays, structures and unions are ‘derived from’ (contain) other types; none of them may be derived from incomplete types. This means that a structure or union cannot contain an example of itself, because its own type is incomplete until the declaration is complete. Since a pointer to an incomplete type is not itself an incomplete type, it can be used in the derivation of arrays, structures and unions.

If any of the types that these things are derived from are qualified with const or volatile, they do not inherit that qualification. This means that if a structure contains a const object, the structure itself is not qualified with const and any non-const members can still be modified. This is what you would expect. However, the Standard does says that if any derived type contains a type that is qualified with const (or recursively any inner type does) then it is not modifiable—so a structure that contains a const cannot be on the left-hand side of an assignment operator.