The article uses C examples but a more general language for the title and text, so if iterators are available in the language &quot;use iterators&quot; is in fact an excellent way to handle it (and you can probably  build C iterators, though I don&#x27;t know how convenient and efficient they&#x27;d be)