I am a beginner in C++ casting. I need to know are static_cast<double> and double ex-changable in any code?
In the following code can I replace static_cast<double> with double? which is much shorter. Do I loose any readability?
a= static_cast<double> ( 3 ) / static_cast<double>( 7 );
How about static_cast of other basic types such as int, char, size_t?
According to explanations they must be the same. But is there any exceptional case?
Aucun commentaire:
Enregistrer un commentaire