myStruct getStruct(){ myStruct val; return val; }Will the instance of myStruct be killed immediately after leaving the function scope? Turns out, this works with structs. Pretty sure it would not work if it were a class. Also strange is that it seems like... All the members of a struct are initialized? Rather than having whatever random data was there before hand? Or maybe I am just lucky... Might want to explicitly init values by specifying a constructor.
Goodbye to All That (2014)
9 years ago
No comments:
Post a Comment