A checksum value is simply a value that cannot be valid.
If my domain is limited to positive non-zero numbers, zero may be sentinel.
If my domain is limited to positive numbers, for which I would use an unsigned integer, I can use a signed integer and a negative number as a control. (Of course, I'm losing the upper half of the range unsigned for this.)
If I use a pointer to indicate a value, a null pointer can be a sentinel.
If I use a c-string, which is a pointer (or an array that breaks into a pointer), I can use a null pointer, or in some cases point to (char) 0 ("empty string" "), as a sentinel.
A watch signal is simply a value that your actual inputs can never be accepted. Since it cannot be mistaken for a valid value, your code can do โsomething specialโ when it sees a sentinel value, something other than the normal processing that it does for a valid value.
source share