···5959 // demonstrate how they are similar and different.
6060 //
6161 // (It turns out that the array prints completely, including
6262- // the sentinel 0 in the middle. The many-item pointer must
6363- // stop at the first sentinel value. The difference is simply
6464- // that arrays have a known length and many-item pointers
6565- // don't.)
6262+ // the sentinel 0 in the middle. The many-item pointer stops
6363+ // at the first sentinel value.)
6664 printSequence(nums);
6765 printSequence(ptr);
6866
+18-2
patches/patches/076_sentinels.patch
···11-86c86
11+38,40d37
22+< // Important: the sentinel value must be of the same type as the
33+< // data being terminated!
44+< //
55+56c53
66+< // numbers that both ends in and CONTAINS the sentinel value.
77+---
88+> // numbers that both ends in and CONTAINS the sentinal value.
99+62,63c59,62
1010+< // the sentinel 0 in the middle. The many-item pointer stops
1111+< // at the first sentinel value.)
1212+---
1313+> // the sentinel 0 in the middle. The many-item pointer must
1414+> // stop at the first sentinel value. The difference is simply
1515+> // that arrays have a known length and many-item pointers
1616+> // don't.)
1717+84c83
218< for (???) |s| {
319---
420> for (my_seq) |s| {
55-98c98
2121+96c95
622< while (??? != my_sentinel) {
723---
824> while (my_seq[i] != my_sentinel) {