#object initialization
11 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.
Stack.
int main() {
test t = makeTest();
cout << t.a;
}
If I call this in the main method
it's able to retrieve t.a, but shouldnt that be deleted because it's out of the makeTest method
No, because makeTest() returns the test by-value.
Some copying takes place and the t variable receives that copy.