Assignment operator reallocation?
1 2 3 4 5 6
|
struct A{
int a;
string b;
}
A var = {2, "test"}; // This creates my object
var = {3, "test2"}; // Does this reallocate memory or reuse it?
|
Line 6 is an assignment operation. No additional memory is allocated (except perhaps a temporary object on the stack).
@AbstractionAnon Thanks!
Topic archived. No new replies allowed.