Re: WHich one is evaluated first

Originally Posted by
monarch_dodra
well, bool is a C-cast. I stay clear away from those
Yes, static_cast is preferable, but when it comes to the primitive types, the c-cast works fine. I only worry when it comes to polymorphism and class pointers in general.
I would hate to write this all over my code
Code:
int I = 10;
int I2 = 3;
float F = static_cast<float>( I ) / I2;
vs
Code:
int I = 10;
int I2 = 3;
float F = (float) I / I2;
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000