Casting (con’td)
- Those that are discernable without the program executing.
- Question of language legality: “Is this a legal statement?” e.g.,
iIndex = chVariable; Statement is not legal.
- Those that are discernable only when the program is running with actual data values.
- Question of execution legality:
“Is it legal for this variable to have the actual value assigned to it?”, e.g.,
animalArray[<badIndex>] = someAnimal
Statement is legal, but particular index value isn’t.