e.solutions interview question

how to implement a function like std::strcpy?