Casting
- Syntax:
(new type)variable;
- Aritmetic casting is automatic.
- You may be explicit about casting to get desired results.
- Casting between structs, unions and other types is not allowed.
Casting between pointers
- All pointers except pointers to functions are the same size.
- Casting to a type void * and back is always valid.
- Casting between any other type is not guaranteed.
next slide