- Oct 10, 2006
- 21,562
- 3
- 0
If I make a function that returns a pointer like so...
class* function(void)
{
class* returnClass = new class();
return returnClass;
}
int main(void)
{
class* cPointer = function();
return 0;
}
Is the class object pointed to by cPointer considered temporary? Just wondering cause I appear to having a problem with memory corruption in a similar scenario.
class* function(void)
{
class* returnClass = new class();
return returnClass;
}
int main(void)
{
class* cPointer = function();
return 0;
}
Is the class object pointed to by cPointer considered temporary? Just wondering cause I appear to having a problem with memory corruption in a similar scenario.
