0

This question stemmed from this (Software Development) textbook question:

A value used to indicate the end of a data stream is called:

  1. a sentinel value.

  2. an end of file (EOF) character.

  3. a flag.

  4. a driver

The correct answer is apparently 1, though I answered 2.

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.

Sentinel value (Textbook)

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.

However, this contradicts what I found on Wikipedia (sources seem legit).

Sentinel value (Wikipedia)

... 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

Then the End-of-file definition.

End-of-file (Wikipedia)

... 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.

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?

sparcut
  • 795
  • 1
  • 10
  • 27

1 Answers1

0

Typically in these Software textbooks, sentinel values are usually associated with file streams and the like.

If I remember correctly, chapters discussing sentinel values generally focused on file handling, so in this case, the answer would be 1.

Wulfinite
  • 209
  • 1
  • 3
  • 9