1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Cast

By David Bolton, About.com

Definition: Casting is a process in C and C++ where a type of a variable or expression is converted into another type, so long as the conversion makes sense.

A pointer is the address of a variable in memory. If we want to look at it, it makes sense to cast it to an int and print that out.

C++ extends casts for greater type safety and robustness.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Also Known As: Type Conversion
Examples:
Casting a text number like "seven" to an int will not work.
Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Glossary
  5. Cast - Definition

©2009 About.com, a part of The New York Times Company.

All rights reserved.