char *ft_strncpy(char *dest, char *src, unsigned int n)
{
unsigned int i;
i = 0;
while (src[i] != '\0' && i < n)
{
dest[i] = src[i];
i++;
}
while (i < n)
{
dest[i] = '\0';
i++;
}
return (dest);
}
/*
#include <stdio.h>
int main(void)
{
char src[] = "bo";
char dest[] = "Bofdfdfd";
printf("%s\n", ft_strncpy(dest, src, 6));
printf("%c\n", dest[5]);
return (0);
}
*/
To embed this project on your website, copy the following code and paste it into your website's HTML: