mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-27 01:46:29 +00:00
Removed confusing explanation from 076
This commit is contained in:
parent
ef4bd3c749
commit
4c7eebbbfc
2 changed files with 20 additions and 6 deletions
|
@ -59,10 +59,8 @@ pub fn main() void {
|
||||||
// demonstrate how they are similar and different.
|
// demonstrate how they are similar and different.
|
||||||
//
|
//
|
||||||
// (It turns out that the array prints completely, including
|
// (It turns out that the array prints completely, including
|
||||||
// the sentinel 0 in the middle. The many-item pointer must
|
// the sentinel 0 in the middle. The many-item pointer stops
|
||||||
// stop at the first sentinel value. The difference is simply
|
// at the first sentinel value.)
|
||||||
// that arrays have a known length and many-item pointers
|
|
||||||
// don't.)
|
|
||||||
printSequence(nums);
|
printSequence(nums);
|
||||||
printSequence(ptr);
|
printSequence(ptr);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,24 @@
|
||||||
86c86
|
38,40d37
|
||||||
|
< // Important: the sentinel value must be of the same type as the
|
||||||
|
< // data being terminated!
|
||||||
|
< //
|
||||||
|
56c53
|
||||||
|
< // numbers that both ends in and CONTAINS the sentinel value.
|
||||||
|
---
|
||||||
|
> // numbers that both ends in and CONTAINS the sentinal value.
|
||||||
|
62,63c59,62
|
||||||
|
< // the sentinel 0 in the middle. The many-item pointer stops
|
||||||
|
< // at the first sentinel value.)
|
||||||
|
---
|
||||||
|
> // the sentinel 0 in the middle. The many-item pointer must
|
||||||
|
> // stop at the first sentinel value. The difference is simply
|
||||||
|
> // that arrays have a known length and many-item pointers
|
||||||
|
> // don't.)
|
||||||
|
84c83
|
||||||
< for (???) |s| {
|
< for (???) |s| {
|
||||||
---
|
---
|
||||||
> for (my_seq) |s| {
|
> for (my_seq) |s| {
|
||||||
98c98
|
96c95
|
||||||
< while (??? != my_sentinel) {
|
< while (??? != my_sentinel) {
|
||||||
---
|
---
|
||||||
> while (my_seq[i] != my_sentinel) {
|
> while (my_seq[i] != my_sentinel) {
|
||||||
|
|
Loading…
Reference in a new issue