What i basically want is more than one character to be found. If h and a are in the string then it will print it. But it will only work if there is a single char.
#include <iostream>
#include <stdio.h>
#include <string.h>
int main ()
{
char str[] = "This is a sample string";
char * pch;
printf ("Looking for the 's' character in \"%s\"...\n",str);
pch=strchr(str,"ha"); //<<<<<<<Doesn't work - If i changed "ha" to 'h' then only h will be found
while (pch!=NULL)
{
printf ("found at %d\n",pch-str+1);
pch=strchr(pch+1,"ha");
}
system("pause");
return 0;
}