Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, if you return an index. I bet the parent poster was discussing returning a pointer, though.

Imagine look4 returned a pointer to the found element. Making look4's signature const-correct in C is not possible.

(Think of strchr).



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: