char *strcpy(char *dst, const char *src)
{
char *cp = dst;
while (*cp++ = *src++);
return dst;
}
char *strncpy(char *dest, const char *source, size_t count)
{
char *start = dest;
while (count && (*dest++ = *source++)) count--;
if (count) while (--count) *dest++ = '\0';
return start;
}
char *strcat(char *dst, const char *src)
{
char *cp = dst;
while (*cp) cp++;
while (*cp++ = *src++);
return dst;
}
size_t strlen(const char * str)
{
const char *s;
for(s = str ; *s ; ++s);
return (s - str);
}
size_t strlen(const char * str)
{
const char *s = str;
while(*s++);
return s-str-1;
}
댓글 없음:
댓글 쓰기