What is the syntax of Casting? What does it do?

How do we use Casts to avoid the Overflow Warning?


Common Pitfalls

<aside> 💡 We cannot perform implicit type casting on the data types which are not compatible with each other such as:

  1. Converting float to an int will truncate the fraction part hence losing the meaning of the value.
  2. Converting double to float will round up the digits.
  3. Converting long int to int will cause dropping of excess high order bits.

Keep in mind the following rules for programming practice when dealing with different data type to prevent from data loss :