Just pointing out that you can replace char arrays with std::vector and avoid C-style strings altogether. It works great for when you need dynamic length C-style strings (ie buffers).

...