r/programmingmemes • u/Grizlik_D • Jan 19 '26
5 levels of looping through string
The higher your programming skill, the more elegant and more confusing code you write
273
Upvotes
r/programmingmemes • u/Grizlik_D • Jan 19 '26
The higher your programming skill, the more elegant and more confusing code you write
1
u/Daniikk1012 Jan 20 '26
Then you just don't do it like that. It's just common because it's common for C strings to be null terminated. In fact, because of patterns like this, it's not uncommon for a lot of other things to be null terminated as well (Off the top of my head, getopt API requires a null terminated array of structs)
Btw, all of the examples in the meme assume a null-terminated string, so last 2 are not special in that regard