C++

Asked • 07/01/19

Why use static_cast<int>(x) instead of (int)x?

I've heard that the `static_cast` function should be preferred to C-style or simple function-style casting. Is this true? Why?

1 Expert Answer

By:

Corbin P. answered • 08/22/20

Tutor
5 (9)

4th Year Computer Engineering Student

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.