Type casting

Get introduced to type casting with the help of an interactive example.

What is type casting?


Type casting is a special kind of operator that converts one datatype to another.


It is a unary operator, and its basic syntax is given below:

(type) (expression);

Types

There are two types of typecasting:

  • Implicit type casting
  • Explicit type casting

Implicit type

...