Original Post
Hi,
This is just something that''s been bugging me lately, and is very basic.
Temprorary objects that are declared within a function...whats the memory management for them?
void SwapVector(Vector &vec1, Vector &vec2)
{
Vector temp;
temp = vec1;
vec1 = vec2;
vec2 = temp;
}
What happens for temp?
Does it get allocated and freed every function call, or does it get allocated once and reused ever function call....or what?
Sorry about how basic this is, i just thought i really should know the answer to something like that.
Thanks anyway.