G
Gernot Frisch
Hello,
assume a simple sting class "DGStr".
Now this:
DGStr foo()
{
DGStr a("test"); // this will call "new char [..]"
return a; // this will call DGStr(a), which will again call "new char[]"
}
Is there a way to just copy the pointer, and do not delete the memory for
the return value of the string?
Know what I mean?
assume a simple sting class "DGStr".
Now this:
DGStr foo()
{
DGStr a("test"); // this will call "new char [..]"
return a; // this will call DGStr(a), which will again call "new char[]"
}
Is there a way to just copy the pointer, and do not delete the memory for
the return value of the string?
Know what I mean?