C Primer Plus 第十一章第六題

6.The strncpy(s1, s2, n) function copies exactly n characters from s2 to s1, truncating s2 or padding it with extra null characters as necessary. The target string may not be null-terminated if the length of s2 is n or more. The function returns s1. Write your own version of this function. Test the function in a complete program that uses a loop to provide input values for feeding to the function.

Posted in 碎碎念

Leave a Reply

Your email address will not be published.