Skip to main content
SWStudyWalks Search

Computer Science / Unit 7   CS 0366 short lesson, about 20 seconds

"The Cast Is Free"

Captions available

The idea

A type cast forcing a large value into a smaller type has a side effect — truncation, bytes dropped — and treating it as harmless turns a known mechanism into a silent bug.

In practice

A total squeezed into a smaller slot arrives smaller, unannounced.

Where people slip

The compiler permitted what someone signed for.

Your place on the trail

Every lesson rests on earlier ones and opens later ones. Tap any to jump.

Something wrong in this lesson? Flag it  ·  Sources for Computer Science