Skip to content

Instantly share code, notes, and snippets.

View kavinyao's full-sized avatar

Kavin Yao kavinyao

View GitHub Profile
@kavinyao
kavinyao / gist:4014994
Created November 5, 2012 02:38 — forked from clippit/gist:4012541
strstr
#include <stdio.h>
const char* my_strstr(const char* haystack, const char* needle) {
if (!*needle)
return haystack;
const char* h = haystack;
const char* n = needle;
while (*h) {
const char* hp = h;