Malloc on a struct containing a std::vector

后端 未结 5 409
甜味超标
甜味超标 2021-01-14 18:30

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

5条回答
  •  滥情空心
    2021-01-14 18:56

    It is undefined behaviour to use a non-initialized object. Exception may be thrown at any time- or not at all.

提交回复
热议问题