Below is the cast:
int foo = (int) somefloat;
However, is it considered cast?
int foo = int( somefloat );
More importantly, if there is a difference between the two, is the resulting compiled code different?
The second example is often called function style creation and was added in C ++, but there is no difference between them in terms of semantics / object code.
Here's a good explanation of the reason that function style styles were added:
What exactly is the purpose of C ++ in the style of functions?
There is no difference in the results, however, only the first example can be used in C. In C ++, you can use both.
Yes, this is also a throw. C ++ allows this casting style; C has only (type)expression formatting. They are equivalent.
(type)expression