#include <stdio.h>

char	*ft_strncpy(char *dest, char *src, unsigned int n)
{
	unsigned int	i;

	i = 0;
	while (i < n && src[i])
	{
		dest[i] = src[i];
		i++;
	}
	while (i < n)
	{
		dest[i] = '\0';
		i++;
	}
	return (dest);
}
/*
int main (void)
{
    char dest[3] = "Bye";
    char src[] = "Hello";

 	printf("src= %s\ndest= %s\n", src, dest);
 	ft_strncpy(dest, src, 2);
 	printf("src= %s\ndest= %s", src, dest);
 	return (0);
}*/

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: