class Tampler
{
public:
Tampler();
private:
const char* m_sMyString;
};
#define TLDR_EXT ".tldr"
const char* GetCurrentDir();
const char *filename = "filename";
Tampler()
{
std::string str(GetCurrentDir());
str = str + filename + TLDR_EXT;
m_sMyString = strdup(str.c_str());
}
Так и C-подход:Tampler()
{
char *tempstr = (char *)malloc(strlen(GetCurrentDir()) + strlen(filename) + strlen(TLDR_EXT) + 1);
strcpy(tempstr, GetCurrentDir());
strcat(tempstr, filename);
strcat(tempstr, TLDR_EXT);
m_sMyString = tempstr;
}