Your my_strcpy function does not need to return a value, so it should be void my_strcpy(). You already have access to the destination array with the s1 parameter. In the function when the loop finishes you have to put this code after the while loop: *s1 = '\0'; This will terminate the string and you won't get the |||||||||| gibberish.
No comments:
Post a Comment