Added #include <cstring> and using std::strcpy;