I'm about to hit the screen with my keyboard as I couldn't convert a char to a string, or simply adding a char to a string.
I have an char array and I want to pick whichever chars I choose in the array to create a string. How do I do that?
string test = "oh my F**king GOD!"
const char* charArray = test.c_str();
string myWord = charArray[0] + charArray[4];
thats how far I got with it. Please help.
string myWord; myWord += charArray[0]; myWord += charArray[4];Cat PlusPlus's way is better, I'm just saying that you can use concatenation for that too.