0

My professor was going over constructors for classes and created them this way ...

ArrayList::ArrayList() : items{new std::string[10]), sz{0} {
}

What is the particular advantage in writing the constructor in this manner as opposed to

items = new std::string[10];
sz = 0;
Jacob Macallan
  • 959
  • 2
  • 8
  • 29

0 Answers0