M
M
Max Suprunenko2015-10-06 19:33:45
C++ / C#
Max Suprunenko, 2015-10-06 19:33:45

Is it possible to change the type of C++ using (int)num?

Is it possible to change the type of C++ using (int)num ? I have a studio and I can not determine whether it is so or not at all? I know that C works

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AxisPod, 2015-10-07
@msuprunenko

And if you don't like C++-style type casting, the sooner you get used to it, the better.

int val = static_cast<int>(54.3f);
std::size_t addr = reinterpret_cast<std::size_t>(&val);

In this case, more control over what and where you bring.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question