now waitaminute,
is this intended as a demostration of the language, or of the api?
your function just calls another function. it doesn't really demonstrate that you are capable of finding the number of times a character appears in a string.
how about we see a reimplementation of instr() in vb instead of just calling it?
for my part, here it is in c:
Code:
int char_count(char *s, char c)
{
int num = 0;
for( ; *s != '\0'; s++)
{
if(*s == c) num++;
}
return num;
}