write the function numchr(). the function has two parameters: a const char * s pointing to the first character in a C-style string, and a char c. return the number of times that c appears inside s
HI, my problem is i keep getting the memory location of char * s, how to i fix it so that i will return an int??
1 2 3 4 5 6 7 8 9 10 11 12 13 14
int * numchr(constchar * s, char c)
{
int * count = 0;
while(*s)
{
if (*s == c) *count++;
s++;
}
}