c++ convert int to float code example
Example 1: cpp float to int
float a = 5.0;
int b = static_cast<int>(a);
Example 2: int to float c++
int a = 3;
float b = (float)a;
float a = 5.0;
int b = static_cast<int>(a);
int a = 3;
float b = (float)a;