how to convert double to int c++ using static cast code example Example: casting to a double in c++ double x; x = (double) 25;