#include <stdio.h>
#include <string.h>
void copier(char dest[], char src[], int taille)
{
strncpy(dest, src, taille - 1);
dest[taille - 1] = '\0';
}
int main()
{
char source[] = "Bonjour";
char destination[5];
copier(destination, source, 5);
printf("Chaine source : %s\n", source);
printf("Chaine destination : %s\n", destination);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: