Primitive constructors versus casting for transformation

What's the difference between:

long myLong; float myFloat = (float) myLong; 

and

 float myFloat = float(myLong); 
+6
c ++ casting constructor
source share
1 answer

There is no difference except the syntax, but in C ++ you really should use templated casting :

+4
source share

All Articles