strncpy的源代码实现
<br />#include <stdio.h>#include <stdlib.h>char* strncpy(char *dest,char *src,unsigned int n){ char *strRtn=dest; while(n && (*dest++=*src++)){ n--; } printf("n:%d/n",n);