Sentinel value

From Wikipedia, the free encyclopedia

In computer programming, a sentinel value (also referred to as a flag value, rogue value, or signal value) is a special value that is used to terminate a loop that processes structured (especially sequential) data. The value should be selected in such a way that it will not be confused with legal data values.

Below are some examples of common sentinel values and their uses:

Sentinel values are often used when searching for something.[1]

[edit] See also

[edit] Notes

  1. ^ McConnell, Steve. "Code Complete" Edition 2 Pg. 621 ISBN - 0-7356-1967-0
In other languages