I see a few problems in your code.
But my main worry is that it does nothing !
for (i = 0; i < l1;)
{
j = 0;
count = 0;
while ( (j<l2)>
{
count++;
i++;
j++;
}
if (count == l2)
{
count1++;
count = 0;
}
else
i++;
}
This code is playing with pointers and counters, but that's all.
Use
Improve question to update your question.
Question: if you have the input
banana and search for
ana, how many occurrences should you have ?
Be cause there is 2 possibilities b
anana and ban
ana, but they overlap.