Type-Casting

In this lesson, you will learn about converting one data type to another.

Introduction

Suppose you have initialized a variable with a char data type. At some point in a program, you need its integer value. In such situations, type-casting comes in.

Type-casting is a way to convert the value of one data type to another data type.

Types of type-casting

Type-casting has two types:

  • Implicit casting
  • Explicit casting

Get hands-on with 1400+ tech skills courses.