C++ Language/Type/Conversion

From Wikibooks, open books for an open world
Jump to navigation Jump to search

If you have a variable of one type, but need to use it in a situation that expects a different type, then you can perform a type conversion.

  1. Promoting Small Integers
  2. Coercion
  3. Casting