Here, start and end pointers are index positions in a string. They mark the beginning and current end of a word while the string is scanned character by character. section 19.2
To split newline-separated words:
- Set start and end to the first character. section 19.2
- Move end forward until it reaches a newline, then save the characters between start and end as a word. section 19.1
- Move both positions to the character after the newline to begin the next word. section 19.2
Figure 19.1. Converting a string of characters into words. In the top example named start, you can keep track of where you are in the character string by using a start and end pointer. In the middle example named found word, you stop changing end when you reach a newline character. In the bottom example named start next, you reset the start and end pointers to the character right after the newline.
The three stages show how the positions mark a word, stop at its newline, and move to the next word. section 19.1
















