found++;
printf("Number of characters: %d\n",found);
}
main()
{
count();
}
which counts the length of the string - i`m just new to strings
my objective is to Count the number of occurrences of a word or letter in a string
example : i have char string1[30] ="addaddaddadd";
and char c="a"; using char c="a"; i want to count how many a does string1[30];
has or have..
}
sorry for my grammar ..
any help is appreciated , thanks
additionally:
2. modern C/++ requires a return type for functions
3. never use gets() (or scanf()), use fgets() instead, read: http://www.gidnetwork.com/b-56.html