Hi
I have a syntax problem which I dont know how to correct. The below line of code is meant to check whether the 1st character of a string is a vowel, if not, then the 1st character is sent to the end of the string & then the program checks whether the next character is a vowel & so on.
string a = "There";
while ( !isvowel(a[0]) )
{
a.insert(a.length(), a[0] ); // error line
a.erase(a[0]);
}
The error message is
initializing argument 1 of `std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]'
- invalid conversion from `char' to `const char*'