This is just idea make it efficient when you are goin to write coode

1. Take two pointer ptr1 and ptr2 pointing to haystack and needle respectively.
2. if contain of ptr1 is equal to contained of ptr2 then
++ptr1 and ++ptr2
3. if ptr2 points to NULL and ptr1 also points to space then
print " you got that string"
return
4. if ptr2 points to NULL and ptr1 not points to space then
goto step 5
5. if contained of ptr1 is not equal to contained of ptr2 then
increment ptr1 untill space come and go to for next string
reset ptr2 (ptr2 should point to again needle
6. if contained of ptr1 is not equal to contained of ptr2 and ptr1==NULL
return -1