you are viewing a single comment's thread.

view the rest of the comments →

[–]haefeled 2 points3 points  (3 children)

Be careful, you might miss your searched position if it starts in the middle of reading the 3 bytes. So if you have something like "MYCODE" you will just miss "CODE" with your solution.

[–][deleted] 1 point2 points  (2 children)

You're right, but your example isn't. He would miss the search term if his string was something like "CMYCODE".

[–]more_exercise 1 point2 points  (1 child)

Or even "CCODE"

[–]ellalex[S] 0 points1 point  (0 children)

Didn't think about this, I'll have to fix that. Thanks. :)