This document discusses different data types in C++. It begins by defining data as a set of values related to variables, and data types as determining the type and operations that can be performed on data. It then covers the main points that:
1) There are built-in/fundamental and derived/user-defined data types in C++. Built-in types include char, int, float, double, void and bool.
2) Derived types are composed of built-in types, such as arrays, structures, unions and classes.
3) User-defined types must be declared before use, such as struct, union, class and enumerations.
The document provides examples and
2. Let’s start the presentation
Data .
Data is a set of values of subjects with respect
to qualitative or quantitative variables.
Data type.
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.
To be continued….
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
4. Data type in c++
Data type
Fundamental Data Type
Data Type Modifiers
Derived Data Type
User Define Data Type
6. Built-in Data Type
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. Derived Data type
They are composed of built-in data types.
Examples are :
array, structure, union, class, pointers etc.
8. User Define Data Type
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. Explain Data Type in C++
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. Explain Data type in C++
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.