Im currently in the process of making a programme that will read an input and then tell the user how many vowels the string has in it.
I have got it working 100% with gets code but i dont want to use that code, i want to use a scanf to get the user to input a string.
Below is the code i currently have:
The code works perfectly with one word, but as you all most probably know scanf reads up to the first space, so when i put in something like, hello hello hello, it comes up saying 2 vowels have been found 3 times. Obviously i dont want this i want it to say 6 vowels have been found.Code:{ char str[100]; printf("Please type a line of text:\n"); scanf("%s",str); }
Is there anyway i can make the scanf read past the spaces?
Any help will be greatly appreciated