3 ms·
I would use the standard ISO C strstr instead of writing the function they are calling find. Yes, we had strstr in 1994; it was in the 1989 ANSI C standard. O
by kazinator 7y ago
I would use the standard ISO C strstr instead of writing the function they are calling find.
Yes, we had strstr in 1994; it was in the 1989 ANSI C standard.
On a very small system, strstr will probably just be naively coded, to save space. On a big system, it might use Knuth-Morrison-Pratt or Boyer-Moore. I don't have to care; by using strstr, that decision is taken care of.
- ericlippert 7y agoAs I noted in the text, the actual problem that we had to solve was complicated by a great many factors not the least of which was the fact that the library had to handle strings from different string encodings.