Aug 9, 2008 at 1:58pm UTC
how to write a program that calls a function and tries to count the number of character in a particular string..an example out is..
Output:
there are 2 m in the word maximum...
and the like..
tnx. :D
Last edited on Aug 9, 2008 at 1:59pm UTC
Aug 9, 2008 at 2:03pm UTC
You'll need to use a loop. I suggest your function prototype look like this
int count_instances( const string& s, char c )
Give it a try and post back if you are still stuck.
BTW, there are three.
Aug 10, 2008 at 12:40pm UTC
haha..oops sory for that.tsk
i cnt write a program now bcoz i dnt have yet my installer because this was recently formatted.cud u giv me a smple program for that output??
i wud really appreciate it..
tnx..(=
Last edited on Aug 10, 2008 at 12:40pm UTC
Aug 10, 2008 at 5:54pm UTC
I'm sorry, but no.
You can do it yourself without thinking too hard.