Types can be converted to other types. For example, built-in types can be converted to other built-in types. Here we will discuss the implicit and explicit conversions.
33.1 Implicit Conversions
Some values can be implicitly
converted into each other. This is true for all the
built-in types. We can convert
char to
int,
int to
double, etc. Example:
int main()
{
char mychar = 64;
int myint = 123;
double mydouble = 456.789;
bool myboolean = true;
myint = mychar;
mydouble = myint;
mychar = myboolean;
}
We can also implicitly convert double to int. However, some information ...