Convert a single character to a string?
You can use the std::string(size_t , char )
constructor:
string firstletter( 1, str[0]);
or you could use string::substr()
:
string firstletter2( str.substr(0, 1));
Off the top of my head, if you're using STL then do this:
string firstLetter(1,str[0]);