Compatible and composite types

C only

In C, compatible types are defined as:

When two compatible types are combined, the result is a composite type. Determining the resultant composite type for two compatible types is similar to following the usual binary conversions of integral types when they are combined with some arithmetic operators.

Obviously, two types that are identical are compatible; their composite type is the same type. Less obvious are the rules governing type compatibility of non-identical types, user-defined types, type-qualified types, and so on. Type specifiers discusses compatibility for basic and user-defined types in C.

End of C only
C++ only

A separate notion of type compatibility as distinct from being of the same type does not exist in C++. Generally speaking, type checking in C++ is stricter than in C: identical types are required in situations where C would only require compatible types.

End of C++ only

Related information



[ Top of Page | Previous Page | Next Page | Contents | Index ]