String error

In the following code, I'm trying to figure out if the first letter of the string is vowel or not. So in my function, I'm using an if statement; however thepig[0] has an error on it. May I possibly know what the problem is... Thanks for taking your time to read this :)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  void transform_piggy(string &pig)
{
	//Declare strings
	string vowels="aeiouAEIOUyY";
	string way="way";
	c

	

	//See if the first letter is vowel
	if (pig[0].find_first_of(vowels)!=string::npos)
	


}
If your compiler gives you an error, then you should show that error message to us. Then we can help you to learn to interpret those messages yourself.

Nevertheless, type char does not have member functions. Besides, why not search one letter from a string rather than a list of characters from one letter?
Topic archived. No new replies allowed.