I was wondering if there is a way to look for a substring
in a char*
array.
I can't seem to find an equivalent of Contains()
from Java
for C
For example:
char *buff = "this is a test string. The string contains random text.";
suppose I input the substring
to compare to buff
and see how many times is substring
found in buff
.
I am able to find the first occurrence but having issues with multiple occurrences. Can someone assist me?