To convert from one type to another in C and other programming languages. To cast to a new type, use the new type surrounded in brackets before the old value. eg int foo = (int)3.33333; //foo = 3

In C++, casts can be overloaded, for instance to make a class return a rounded up float member when cast to an integer, use a type conversion operator such as this:

...
operator int() { return my_float + 0.5; }
...

See also contexts in Perl.