In the C and C++ languages, an incomplete type is "lacking sufficient information to determine the size of objects of that type." (Examples: variable-length arrays, forward declarations of `struct`s, and the `void` type.)
In the C and C++ programming language, an incomplete type is
"lacking sufficient information to determine the size of objects of that type." — ISO C11 standard, section 6.2.5
Examples:
The standard mentions the following three instances of incomplete types:
- an array type of variable, or unknown size, such as
char *argv[]
. - a type that describes an object but lacks information to determine their sizes, such as
struct foo_tag;
- the
void
type (which, unlike the other two, cannot be completed)
Resources:
- ISO C11 standard: ISO/IEC 9899:2011: "Information technology — Programming languages — C"
- Freely available committee draft of the ISO C11 standard (PDF)
- Oracle's Sun Studio documentation article about incomplete types
- EETimes article that describes the use of incomplete types to achieve abstraction.