Hey guys, I have the following two pieces of code and I am trying to combine them so it will say if hello is found and it is at the start or the prevous character is whitespace then add one to the count but when i try to combine these two pieces of code to do that my syntax is all wrong.
Any help would be great. Thanks.
char * ch = array;
while((ch = strstr( ch, "hello")) != 0)
{
Count++;
ch++;
}
if(ch == array || isspace(*(ch-1)))
{
count++
ch++
}