String with Vowel Removal

I'm trying to write a program that uses a loop to remove vowels from words. I'm really bad at this programming thing, so I'm super sorry if my code looks awful. I am getting an error code "[Error] expected unqualified-id before '{' token" when compiling, so there's no telling at this point if the code will even work. But, I need to get rid of that blasted error.

Here's my code:


1 #include <iostream>
2 #include <string>
3 #include <vector>
4 using namespace std;
5
6 // Function Prototype:
7
8 void RemoveVowel(string);
9
10 // Removes vowels from input string.
11 {
12 string dictionary = "aeiouAEIOU";
13
14 // Read string.
15
15 int j = 0;
16 for (size_t i = 0; i < s.size(); i++)
17 if (dictionary.find( s[i] ) == string::npos)
18 s[j++] = s[i];
19
20 // Remove the vowels.
21
22 s.erase(j);
23 }
24
25 int mian ()
26 {
27
28 // Request input string with option of program end.
29
30 cout << "Enter a word or series of words, " << '\n';
31 cout << "or enter 0 to quit: " << endl;
32
33 vector<string>vs;
34 string word;
35 while (getline (cin, word))
36 {
37 if (word=="0") break;
38 removeVowel(word);
39 vs.push_back(word);
40 }
41
42 // Display the string without vowels.
43
44 cout << "The word(s) entered reflecting only consonants: ";
45 cout << removeVowel << endl;
46
47 return 0;
48 }


Sorry if this is confusing, I don't know how to take an image to post in the forums. So I had to copy/paste/edit to fit :/.
1
2
3
4
void RemoveVowel(string);

 // Removes vowels from input string.
 {
You have errorneous ; between ) and {
Also you forgot to name your parameter.
Hmm. I removed the ; and am being told s is not defined in this scope. Is that what you mean by naming the parameter? I need to define s?
What is s? Where did you tell compiler anything about it type, size, content or anything?
Topic archived. No new replies allowed.