M4S2 Flashcards
is the process of converting one predefined
type into another.
Type Conversion
is the process of converting one predefined
type into another.
Type Conversion
When variables of one type are mixed with variables of another
type, what will occur?
a type conversion
C++ facilitates the type conversion into the following two forms:
Implicit Type Conversion
Explicit Type Conversion
also known as automatic type conversion
implicit
a conversion
performed by the compiler without programmer’s intervention.
implicit
It is applied generally whenever differing data types are intermixed in
an expression, so as not to lose information.
implicit
Conversion from one data
type to another is prone to
data loss
This happens when
data of a larger type is
converted to data of a smaller
type.
data loss
data type heirarchy
long double, double, float, long, int, short, char
When the user manually changes data from one type to another, this
is known as
explicit conversion
forces an expression to be of specific data type.
explicit conversion
is used to find
the power of the given
number
pow()
returns the square root
of value.
sqrt()
math
functions are part of
X header.
both
are used to retrieve or calculate
the absolute value
abs() and fabs () functions
X is used
to calculate the absolute value for
integer type numbers
abs()
X are used for
floating type numbers.
fabs()