Vowel Removal: I'm doing it wrong. C+

Well, I had a different code before, but I started over because I was just lost. I'm very new to this world of programming, and unfortunately I can't say I'm a natural.

I'm getting error code "[Error] expected primary-expression before 'char'". Not sure what that even means :/. Please help!!!

EDIT: I forgot to mention that the error is stating that the problem is before withVowel here:

1
2
// Read the user input.
getline(cin, withVowel, '\n');


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <string>
using namespace std;


string removeVowel(string);				// Removes vowels from input string.
string withVowel;						// Will be used to read user input. 

int mian ()
{	

	const int SENTINEL = 0;				// Sentinel value. 
	int withVowel;				            	// IN: User input word(s).
	int removeVowel;					// OUT: User input word(s) less vowel(s).
	
	// Request input string unless sentinel is entered.  
	
	cout << "Enter a word or series of words. " << '\n';
	cout << "Or, enter" << SENTINEL << "to quit. " << endl;
	cin >> withVowel;
	
	// Read the user input.
	getline(cin, withVowel, '\n');
	
	// Remove vowel(s).	
	while (withVowel != SENTINEL)
	{
		switch(withVowel)
        	{
               	case 'a':
                case 'A':
             	case 'e':
              	case 'E':
               	case 'i':
	            case 'I':
	            case 'o':
	            case 'O':
	            case 'u':
	            case 'U':
                {
                        cout << "";
                        break;
                }
                default:
               
		// Display the string without vowels.	
                
                cout << "The word(s) entered reflecting only consonants :" << removeVowel << endl;
                }

	}
	
	return 0;
}
Last edited on
getline uses a string not an int
Topic archived. No new replies allowed.