S
S
Sasha2942018-10-12 06:47:13
C++ / C#
Sasha294, 2018-10-12 06:47:13

What are the ways to translate from one data type to another?

What are the ways to translate from one data type to another c++

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2018-10-12
@Mercury13

1. Using the type conversion functions built into C++ or written by the user. This can be done implicitly, via a C-style cast, via a constructor call, via a static_cast operation.
2. With the conversion of the pointer down the inheritance hierarchy, and special behavior, if this did not work out, through the dynamic_cast operation and the dynamic_pointer_cast function.
3. Considering a piece of memory as a variable of an incompatible type. Through union, const_cast, reinterpret_cast, C-style cast of pointers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question