[Solved] (C++)trying to convert double to integer (explaining) [closed]


You don’t have to add (Double) there, why indeed. You are converting 50.2 to int wich evaluates to 50, then you are converting 50 back to double wich stays at 50 If you print it. The only reason i can think to do this is If it’s inside some function with a return double value or to extract the integer part of a Double value, but it’s not a good practice at all.

7

solved (C++)trying to convert double to integer (explaining) [closed]