Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Dec 10, 2023
1 parent a3a69a9 commit 1eee1e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ def main() -> int:
return 0
```

You can also use the `++` operator to move a pointer forward by one item.
It moves one byte at a time, because we have a `byte*` pointer.
You can also use the `++` and `--` operator to move pointers by one item at a time.
They move strings one byte at a time, because strings are `byte*` pointers.

```python
import "stdlib/io.jou"
Expand All @@ -533,6 +533,9 @@ def main() -> int:
printf("%s\n", s) # Output: ello
s++
printf("%s\n", s) # Output: llo
s--
s--
printf("%s\n", s) # Output: hello
return 0
```

Expand Down

0 comments on commit 1eee1e1

Please sign in to comment.