I'm doing a few exercises in which I have to compare words from a string of characters entered by the user, in an exercise I have to see how many times a word is repeated in the whole chain that the user entered and in another exercise I have to see if a word has IE
, if it has it, I have to print that word in specific.
The problem here is that I have no idea how to separate words from all char
to then be able to work with the words separately.
How can I separate the words entered, according to what I describe in my question?
This is the code:
#include <stdio.h>
#include <stdlib.h>
int main()
{//Programa para ver frecuencia de palabras
char cadena[60];
int i,j;//Controladores de los ciclos for
printf("Ingresa una oracion\n");
scanf("%[^\n]"&cadena);
return 0;
}