vector<char*> m_Text;
m_Text.resize(1 );
char* foo = "FOO";
char* bar = "BAR";
char* foobar = (char*)malloc(s trlen(foo) + strlen(bar) + 1);
if (foobar)
{
strcpy(foobar, foo);
strcat(foobar, bar);
}
m_Text[0] = foobar;
// Will m_Text[0] get freed when m_Text goes out of scope? If not, should I
call free(m_Text[0]) in the destructor?
m_Text.resize(1 );
char* foo = "FOO";
char* bar = "BAR";
char* foobar = (char*)malloc(s trlen(foo) + strlen(bar) + 1);
if (foobar)
{
strcpy(foobar, foo);
strcat(foobar, bar);
}
m_Text[0] = foobar;
// Will m_Text[0] get freed when m_Text goes out of scope? If not, should I
call free(m_Text[0]) in the destructor?
Comment