what is meant by Type casting?

Explain your own answer with proper example?

  • Rahul
  • 12 Jul
  • 14188 Views
  • 42 Answers
Your Answer

Type casting means "type/datatype conversion " in program ..
Typecasting is a way of converting the datatype of one variable to some other datatype. It is of two types—implicit (done by compiler) and explicit(done by programmer).In implicit typecasting,there is no loss of information but inexplicit(which is often done by us)some information is lost. For example—
float x=8.6;
int y =(int)x ;
What the second statement will do, it will typecast the x from float to integer value and the value of y will be 8 however there will be no change on the original x (it will remain 8.6). 
 

C Language

Didn't get the answer.
Contact people of Talent-C Language directly by clicking here