1

Is it necessary to initialize ;

- vector<string>
- vector<string*>

in constructor ?

1
  • better use the reference counting smart pointer instead of * Commented Mar 5, 2011 at 17:27

1 Answer 1

6

No. Default initialization will be fine.

For vector<string *> you will however need a destructor, a copy constructor and an assignment operator in order to properly delete/copy the string * elements in your vector<string *> member variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.