Untitled
unknown
plain_text
2 years ago
353 B
8
Indexable
char *ft_strncat(char *dest, char *src, unsigned int nb)
{
int i;
unsigned int j;
i = 0;
j = 0;
while (dest[i] != '\0')
i++;
while (j < nb)
{
dest[i] = src[j];
i++;
j++;
}
dest[i] = '\0';
return (dest);
}
#include <stdio.h>
int main(void)
{
char s1[] = "Pam";
char s2[] = "Moe";
printf("%s", strncat(s1, s2,3));
return (0);
}Editor is loading...