In computer programming, a sentinel value (also referred to as a flag value, rogue value, or signal value)citation needed 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: