I have been reading "The C Programming Language" and I got to this problem, that my output is 0 for any given string I send.
My function looks like this:
 int number_of_repeating(char *word,char k){
    int b=0,len=0,i;
    gets(word);
    len=strlen(word);
    for(i=0;i<len;i++){
        if(word[i]==k)
        b++;
    }
    return  b;
}
Problem:
I send him word for example: Jhonny, and character n, so it should count number of n's in the word (in this case the output should be 2).
What am I doing wrong?
 
     
     
    