previous |
start |
next
Processing a Sequence of Inputs (Sentinels)
- Whenever you read a sequence of input values,
you need to have some method of terminating the input.
- A number used to signal termination is called a
sentinel.
- Sentinels only work if there is some
restriction on the input.
- Common sentinel values are 0 or -1.
previous |
start |
next