Need C++ implementation of KMP algorithm

I am looking for a simple C++ implementation of KMP (Knuth-Morris-Pratt) algorithm. I was able to understand the concept from this article . But it didn't have a code implementation. I checked few other places, but code was pretty hard to go through. Please share some compact implementation of KMP in C++ (preferably with comments).
Duck found this very simple implementation; (test it thoroughly before accepting it).
Topic archived. No new replies allowed.