Question: The function mystrncpy copies characters from src to dst until either a '0' character is found in src or until n characters are copied, whichever
char * mystrncpy(char * dst, char * src, int n) {
char * dstsave = dst;
while (n > 0 && __________________) {
______________ = _______________;
n--;
}
// fill remainder of dst (if any) with zeros
while (n>0) {
_____________________ = '\0';
______________________________;
}
return dstsave;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
