correct algo for deep copying a string in c++ [closed]

  c++, constructor, deep-copy

this is the code i have for deep copying a string in copy constructor
p status is the character pointer.
so is the logic correct??

void Monkey::deepCopy(const Monkey& m)
{
    
    if (m.pStatus)
    {
        // allocate memory for our copy
        pStatus= new char[sizeof(m.pStatus)];
 
        for (int i{ 0 }; i < sizeof(m.pStatus); ++i)
            pStatus[i] = m.pStatus[i];
    }
    else
        pStatus = nullptr;
}

Source: Windows Questions C++

LEAVE A COMMENT