2 ms·
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
by jjnoakes 9y ago
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).