I am working with dynamically allocated arrays that are template type.
I know it is a common practice to set declared arrays to 0, but since the type of the array can be a char or string then I thought about setting it to NULL. Would this work?
1 2 3
for(int i = 0; i < maxSize; i++){
array[i] = NULL; // ???
}
you can use the empty braced initializer in both cases but std::string still poses differences vis-a-vis other POD such as std::getline() vs std::cin. So it might make sense to specialize the template function for std::string: