Hacker News new | ask | show | jobs
by Nick_C 5241 days ago
> not using things like strlen() when iterating through a C-string

At the risk of making myself look stupid, is that because of O(n) vs O(n^2) (should be testing for \0), or is there another reason I'm not picking up?

1 comments

Yeah, it's just to see if a person understands that some basic pointer operations and that regular strings in C are "special" because of their \0 at the end.