I've seen code where data structure of such type:
struct TestStruct
{
int a;
std::string b;
};
although it contains std:string
in it, gets initialized as:
TestStruct t;
memset(&t, 0, sizeof(TestStruct));
to some my knowledge and other posts I have read, above initialization should have caused program crash (due to the fact that struct TestStruct containst std::string), but the application seems to not crash, any ideas why? Thanks.