Q18: Explain type casting concept in C language. OR What is type casting? How it is different from type conversion? ***

A18:

Type Casting:

Type casting refers to the explicit conversion of a value from one data type to another. Type casting is done using casting operators.

C provides two casting operators:

Implicit Type Casting: This is done automatically by the compiler when there is no loss of information in the conversion.

Explicit Type Casting: This is done explicitly by the programmer using casting operators like (type).

 

Type Conversion:

Type conversion includes both implicit and explicit type casting. It refers to the process of converting a value from one data type to another, implicit or explicit.


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.