Hello I have this code
char * oldname = new char[strlen(name) + 1];
memcpy(oldname,name,strlen(name) + 1);
name = new char[strlen(oldname) + strlen(r.name) + 1];
memset(name, '\0', strlen(name));
strcat(name,oldname);
strcat(name," ");
strcat(name,r.name);
I understand that it is a no no to use memcpy and memset but I haven't understood exactly how to use this in C++, preferably without std.
Does anyone know? Thank you.