use static_cast : static cast « Development « C++






use static_cast

use static_cast

#include <iostream>
using namespace std;

int main()
{
  int i;
  float f;

  f = 199.22;

  i = static_cast<int> (f);

  cout << i;

  return 0;
}


           
       








Related examples in the same category

1.Use static_cast.Use static_cast.