In C++ program, a cast is typically a special operator that forces one data type to be converted into another. It is unary as an operator and has the same precedence as any other unary operator.
The general syntax is shown below:
type-name (expression) //c++ notation
Example:
#include <iostream>
main()
{
double a = 99.09399;
float b = 97.20;
int c ;
c = (int) a;
cout << "Line 1 - Value of (int)a is :" << c << endl ;
c = (int) b;
cout << "Line 2 - Value of (int)b is :" << c << endl ;
return 0;
}