Actions

EmSys

C - Implicit Type Conversion

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Implicit Type Conversion

  • When an operator has operands of different types, they are converted from a narrower operand into a wider one without loosing information.
  • Implicit type conversion is done automatically by the C – compiler.

e.g,

float f1, f2;
int i = 10;
f1 = f2 = 20.713489;
f1 = f2 + i; 
// i is converted to float before the addition takes place.