strncpy源码

3648阅读 1评论2010-12-22 shenhailuanma
分类:LINUX

strncpy源码

char *strncpy(char *dest, const char *src, size_t count)
{
    char *tmp = dest;

    while (count) {
        if ((*tmp = *src) != 0)
            src++;
        tmp++;
        count--;
    }
    return dest;
}


上一篇:strcpy源码
下一篇:压缩解压缩命令——tar

文章评论