Ok Shiro I get you.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int cama (char *msg, char src);
int main(void)
{
int len = 0, i;
char *msg[] = {
"String one",
"String two",
"String three",
"String four",
};
for(i=0;i<5;++i)
len += cama(*(msg+i),'e');
printf("The char 'g' appears %d\n",len);
getchar();
return 0;
}
int cama (char *msg, char src)
{
int len = strlen(msg);
int i,l = 0;
for(i=0; i<len; ++i,++msg)
if(*msg == src)
++l;
return l;
}
But it's not better to pass all the array of pointers instead checking string by string or its the same thing?
Thank you!