title: What's the difference between a Sentinel value and an End-of-file character?
body: <p>This question stemmed from this (Software Development) textbook question:</p>
  
  <blockquote>
    <p>A value used to indicate the end of a data stream is called:</p>
    
    <ol>
    <li><p>a sentinel value.</p></li>
    <li><p>an end of file (EOF) character.</p></li>
    <li><p>a flag.</p></li>
    <li><p>a driver</p></li>
    </ol>
  </blockquote>
  
  <p>The correct answer is apparently 1, though I answered 2.</p>
  
  <p>I wasn't able to find a definition in the textbook of an end of file character though I did find the definition of a sentinel value.</p>
  
  <blockquote>
    <p><strong>Sentinel value</strong> <em>(Textbook)</em></p>
    
    <p><em>A dummy value used to indicate the end of data within a file. Sentinel is from the word sentry, a sentry being a guard who prevents passage of unauthorised persons.</em></p>
  </blockquote>
  
  <p>However, this contradicts what I found on Wikipedia (sources seem legit).</p>
  
  <blockquote>
    <p><strong>Sentinel value</strong> <em><a href="https://en.wikipedia.org/wiki/Sentinel_value" rel="nofollow noreferrer">(Wikipedia)</a></em></p>
    
    <p>... <em>a special value in the context of an algorithm which uses its presence as a condition of termination, typically in a loop or recursive algorithm</em></p>
  </blockquote>
  
  <p>Then the End-of-file definition.</p>
  
  <blockquote>
    <p><strong>End-of-file</strong> <em><a href="https://en.wikipedia.org/wiki/End-of-file" rel="nofollow noreferrer">(Wikipedia)</a></em></p>
    
    <p>... <em>a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream.</em></p>
  </blockquote>
  
  <p>So, from this, it seems the better (or correct?) answer is 2 since the question is asking about a "data stream". Does this mean the textbook definition is wrong or "dumbed down", or is an End-of-file character classed as a sentinel value?</p>