Thursday, March 2, 2017

sentinel

This is a name for a value that really is a special encoding, not to be literally used as a value. If foo is an integer and you are to fish something out of an array at the foo position unless foo is negative one then -1 is a sentinel in that regard as you could not otherwise get something at position -1 out of an array. In this situation zero and up are actual values for foo and negative one is a sentinel.

No comments:

Post a Comment