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
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.
Chat with our AI personalities
integer data type
There is no builtin function 'counta' in C.
A character data type.
There is no such data type. However, when we use user-defined data types of our own type, then that type of data can be stored in a variable. So as a term, you may say that user-defined data type can store any data. As the data-type used in any variable will be depending upon us.
Data Type defines the type of data that will be stored. Example : int, byte, short etc