Recommended Posts

Hi, I would like to know if when placing a class inside a struct, and then, when creating a reference of that struct, the constructor / destructor of the class inside, is called:
class TARGET { whatever... }
struct TEST1
{
TARGET x;
}
TEST1* y = new TEST1;
delete y;

0

Share this post

Link to post

Share on other sites

Share this post

Link to post

Share on other sites

I wouldn't have thought so - the structure itself doesn't have a constructor as such, although one can be provided. The best way to find out is to write a test program (and quicker than posting here!):