sorry if this question has already been asked here, I didn't find answer, so I'm trying to do a programme for count somme lettre in text, here is my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// ƒ to count the lettre E
void lettreCount(char *saisi, int length){
int i, count = 0;
for (i = 0; i < length; i++){ //loop for find and count lettre
if (strchr(&saisi[i],"e")){ //verification of lettre
++i;
count++;
}
}
printf("Dans votre text il y a %d de lettre \"e\"\n", count);
}
int main(){
char text[132]; //Array for text
int len;
printf("Saisissez le text:\n");
gets(text);
len = strlen(text);
lettreCount(text, len);
}
but i get all time this warning:
incompatible pointer to integer conversion passing 'char [2]' to parameter of type 'int' [-Wint-conversion]
if (strchr(&saisi[i],"e")){ //verification of lettre
^~~
what do i do wrong?