First version
void assign(char set[]) {
m_ptr = new char[strlen(set) + 1];
strcpy(m_ptr, set);
This code creates a new character array and copies the characters from the old array to the new one. So you end up with two character arrays and two pointers, each pointing at one of the character arrays. Both array contents are the same however.
Second version
void assign(char set[]) {
m_ptr = set;
This time no new character array is created, instead you copy the pointer, so there is only one character array and both pointers point at it.
These are very different outcomes and it's really up to you to decide which one is best for you. Normally however the first is preferred. The problem with the second is that you end up with two pointing pointing at the same data. In this situation any changes to the array will be seen by both pointers, which is potentially confusing. Also if the array needs deleting then it's not clear whose responsibility that is, since either pointer could be used to delete the array.
So I would use the first version unless you feel you have a strong reason not to.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…