I'm using CodeBlocks and C as a programming language. I need to make a function that counts how many times a character read appears in a string (also read). Line 8 error: subscripted value is neither array nor pointer nor vector
#include<stdio.h>
#include<string.h>
int find(char s, char ch, int l)
{
int i, j=0;
for(i=0; i<l; i++)
{
if(strcmp(s[i],ch)==0)
j++;
}
return j;
}
int main()
{
char s[30];
int i,j,l;
char ch;
printf("Enter the string: ");
gets(s);
l = strlen(s)+1;
printf("Enter the character: ");
scanf("%c",&ch);
j=find(s, ch, l);
printf("\n%c occurs %d times",ch,j);
return 0;
}