Vector as a class member

后端 未结 4 1310
醉梦人生
醉梦人生 2020-12-15 13:36

Hello I have this question: I would like to have a vector as class member. This is perhaps my question easier for you and I apologize for that.

  • how should I de
4条回答
  •  死守一世寂寞
    2020-12-15 14:04

    You most certainly want to use std::vector myVector. No need to initialize it, as it gets automatically initialized in the constructor of your class and deallocated when your class is destroyed.

提交回复
热议问题