将源字符串的前count个字符拷贝到目的字符串中
char *strncpy(char *dest, const char *src, unsigned int count)
{assert((NULL != dest) && (NULL != dsrc));char *ret = dest;if (0 == count){return dest;}while (count-- > 0){if (!(*ret++ = *src++)) //'\0'{return dest;}}*ret = '\0';//切记!!!!!return dest;
}