hello. i need a help with my program. i have to input a sentence then a word. my program should find the number of entered word in sentence:
for example : i love apple. apple is good. apple is perfect :p
word: apple
count of apple: 3
please help me with my code
int main (void){
char sentence[81];
char iteration[81];
int count;
int letters = 0;
int space = 0;
int another = 0;
int i =0;
gets(sentence);
cout << "enter a word" << endl;
gets(iteration);
while( sentence[i] != NULL ){
if(isEqual(sentence, iteration) == 1){
count ++;}
/*else if( isEqual(sentence, iteration) == 0 )*/
i++;}