Original Post
Object CreateObject(Object *o)
{
///code
///code
///code
return o;
}
I have a question about a function similar to this. Typically when a function returns a value, you'd have a call similar to below...
z = result(x, y);
My question with the above code, is, if I'm storing the address of 'o' somewhere in the function, but don't 'catch' it's return value in a variable, does this create a memory leak?
{
///code
///code
///code
return o;
}
I have a question about a function similar to this. Typically when a function returns a value, you'd have a call similar to below...
z = result(x, y);
My question with the above code, is, if I'm storing the address of 'o' somewhere in the function, but don't 'catch' it's return value in a variable, does this create a memory leak?