printf("Enter a string of less than 50 characters:\n");
scanf("%s",str);
count_abc(str,a_count,b_count,c_count);
printf("number of a = %d , number of b = %d , number of c = %d\n",count_table[0],count_table[1],count_table[2]);
}

05-25-2009

prog-bman

I think you mean to to this

Code:

(*a)++;

And so on for the other ones.

05-25-2009

cas

You'll also want to advance your pointer (str++) in the loop, or else you'll have an infinite loop checking the first character over and over again. Unless, of course, you pass in an empty string, but that doesn't seem too useful.

You also don't need to create new variables for passing in pointers. Your function call can look like: