> 3. An actual loop is typically quicker than an "unrolled" loop (where > you just repeat the loop body) as it results in smaller code and thus > better cache coherency. I'm not sure whether it was the OP's intention to talk about the (dis)advantages of unrolled code. > All things considered, strcmp() is likely to be faster. Given these things: 1. The null byte check is mandatory. 2. The haystack string is not _considerably_ larger than the needle string. - To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html