1、函数原型。
#include <stdio.h> char *strncpy(char *s1, const char *s2, size_t n) { char *tmp = s1; while(n) { if(!(*s1++ = *s2++)) break; n--; } while(n--) *s1++ = '
1、函数原型。
#include <stdio.h> char *strncpy(char *s1, const char *s2, size_t n) { char *tmp = s1; while(n) { if(!(*s1++ = *s2++)) break; n--; } while(n--) *s1++ = '