Casting operators - C++ Data Type

C++ examples for Data Type:Cast

Description

Casting operators

Demo Code

int main() {/*  www . j  a  v a 2  s.  c om*/
   int b = 200;
   unsigned long a = (unsigned long int)b;
}

Function Call Cast

Demo Code

int main() {/*from  w w  w  .  j av a 2 s . c  o m*/
   float a = float(200);
   // This is equivalent to:
   float b = (float)200;
}

Related Tutorials