Hi,
Is it safe to have a pointer to a string.c_str() created locally inside
a function? For example, would the following code give me headace if a
try to use "c" after calling foo() ?
const char *c;
void foo ()
{
string str = "Hello";
c = str.c_str();
}
Thanks,
Oguz
Is it safe to have a pointer to a string.c_str() created locally inside
a function? For example, would the following code give me headace if a
try to use "c" after calling foo() ?
const char *c;
void foo ()
{
string str = "Hello";
c = str.c_str();
}
Thanks,
Oguz
Comment