answersLogoWhite

0

C and C++ have many types, however we often use the terms fundamental types, integral types, arithmetic types, built-in types and user-defined types when referring to a collection of types. Each has a specific meaning, however there is some overlap, so to make things clearer we need to work from the ground up, starting with the fundamental types:

Fundamental Types

Boolean (type bool)

Character (such as char and wchar_t)

Integer (such as int and long long)

Floating-point (such as float and long double)

No type (void)

From these fundamental types we can construct other types using declarative operators:

Pointer and Reference Types

Array types (such as char[])

Pointer types (such as int*)

Reference types (such as double& and vector&&) [C++ only]

Users can also define additional types:

User-defined Types

Data structures (struct)

Classes (struct and class) [C++ only]

Enumeration types (enum)

Enumeration classes (enum class) [C++ only]

The Boolean, character and integer types are collectively known as the integral types. The integral and floating point types are known as the arithmetic types. The fundamental types, the pointer and reference types are known as the built-in types. The remainder are user-defined types.

It should be noted that both C and C++ provide user-defined types as part of their respective standard libraries. Put simply, a user-defined type is one where a definition for that type must be provided by the user, either by explicitly defining that type or by including a header that contains the definition of that type. This naturally includes aliases (typedef types). The built-in types require no explicit definition, hence they are known as the built-in types.

User Avatar

Wiki User

9y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
JudyJudy
Simplicity is my specialty.
Chat with Judy

Add your answer:

Earn +20 pts
Q: What is a built-in data type?
Write your answer...
Submit
Still have questions?
magnify glass
imp