/***************begin************************/ int index = 0; int rslt = 0; char *pp = str1; while (*pp != 0) { if (*pp == ch) { rslt = index+1; } pp++; index++; } return rslt; /*******************end********************/