I recently purchased the book C++ for C Programmers, 3rd Ed. by Ira Pohl. It was a $40 book for only $10. It's telling me that instead of something like
I should use the keyword static_cast like soCode:int i = 3; cout << 2/double(i);
I don't really understand why this is. Of course, I'm just judging this on the fact that the latter method is longer to type. Please tell me why the latter method is perferable. Thanks.Code:int i = 3; cout << 2/static_cast<double>(i);