Invezz.com - Grow your wealth with trading signals
Basic Data Types in C++
1.
2. A data type determines the type and the operations
that can be performed on the data. C++ provides
various data types and each data type is represented
differently within the computer's memory.
3. Classified of Basic Data Types in C++
There are many data-types available in C++.
They are classified under two categories:
Built-In or Fundamental Data types
Derived or User-Defined Data types
6. Built-in data types are the most basic data-types in C++.
The term built-in means that they are pre-defined in C++
and can be used directly in a program.
Example:
• Character char
• Integer int
• Floating point float
• Double floating point double
Apart from these, we also have void and bool data types.
7. They are composed of built-in data types.
Examples are :
array, structure, union, class, pointers etc
8. User-Defined Data types
User-defined data types are those which are
first declared and defined by the user before
use.
Example: struct ; union ; class; enumeration; are
User defined types
9. Char: Characters refer to the alphabet, numbers and other
characters (such as {, @, #, etc.) defined in the ASCII character set.
Int: Numbers without the fractional part represent integer data. In C++, the int
data type is used to store integers such as 4, 42, 5233, -32, -745.
Floating point Data Type: A floating-point data type is used to store real
numbers such as 3 .28, 64. 755765, 8.01, -24.53.
Void: The void data type is used for specifying an empty parameter list unction
and return type for a function.
Bool : The boo1data type can hold only Boolean values, that is; either true or false,
where true represents 1 and false represents 0.
10. Array : An array is a set of elements of the same data type that are referred to
by the same name.
Function: A function is a self-contained program segment that carries out a
pacific well-defined task.
Reference: A reference is an alternative name for a variable.
That is, a reference is an alias for a variable in a program.