I've been trying to append an integer to a string, and I've tried several solutions here, including:
std::stringstream ss;
ss << gvHours << "\'" << gvMinutes << "\"" << gvSeconds << ":" << gvTicks;
std::string output(ss.str());
return output.c_str();
and
std::stringstream ss;
std::string output = "";
ss << gvHours << "\'" << gvMinutes << "\"" << gvSeconds << ":" << gvTicks;
output = ss.str();
return output.c_str();
The first one gives me an empty string, and the second gives me an unreadable character that Notepad++ displays as "SOH" in a black box. Does anyone have any idea what I'm doing wrong?