Hello,
I'm wondering when is necessary/better declare a pointer to an object in a class or a pointer to a vector in a class
What's the thing that lead me to opt one or other?Qt Code:
class A { public: vector<flaoat> fvec; //or vector<float>* fpvec; A() { fvec.resize(1000); //or fpvec = new vector<float>(1000); } };To copy to clipboard, switch view to plain text mode
THe same question if I had a Person p[10]; in the class. Should be better take a pointer to an array of person? How to choice?
thanks
Bookmarks