Malloc on a struct containing a std::vector
问题 Here is the situation : I use a malloc to allocate memory for a struct. The struct contains various items such as pointers, string variables and vectors. The fact is, when we use malloc, no constructors are called. Using a code similar to the following one, I've experienced some situation where some variables worked while others didn't. Note : The following code doesn't compile. It's purpose is only to illustrate the situation. struct MyStruct { MyClass* mFirstClass; bool mBool; std::string