Thank you for the suggestion to use unique_ptr. I did that and it all seems to work. I was able to build using -pedantic.
Please have another look and make sure I used unique_ptr correctly. One question I had is whether it is better to use cstr.get() + i*eltLen (which is what I did) or &cstr[i*eltLen] to access a pointer to an element cstr, a char held by a std::unique_ptr