[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function stroccur - count the occurences of a substring
within a string
Syntax int stroccur(str *str, char *substr);
Prototype in stringhk.h
Remarks stroccur counts the number of times the string
substr appears with the string str.
Return value returns the number of times the string substr
appears within the string str.
Example #include <stringhk.h>
#include <stdio.h> /* for the printf */
main()
{
char original[] = "This is his test";
printf("%d\n",stroccur(original,"is"));
}
Program output 3
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson