Detailed explanation of data type conversion in C++ and its function
This article mainly explains "detailed explanation and function introduction of data type conversion in C++", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the detailed explanation of data type conversion in C++ and its function introduction.
Catalogue
Overview
Conversion between different types of data
Implicit type conversion
Forced type conversion
Self-declared type conversion
Conversion constructor
Type conversion function
Case
Application
Overview
In daily development, we often use data type conversion, so we should have some understanding of data type conversion.
Conversion between different types of data
In C++, some standard types of data can be converted automatically.
Implicit type conversion
Implicit type conversion: done automatically by the C++ compiler system, we do not need to intervene. For example:
Int main () {int a = 6; a = a + 3.5; cout