ShriRam Changed status to publish July 16, 2022
strncpy ( ) Copies given number of characters of one string to another
#include<stdio.h>
#include<string.h>
int main()
{
char src[] = "Jai Shri Ram";
char dest[8];
strncpy(dest, src, 8);
dest[8] = '\0';
printf("%s\n", dest);
}
ShriRam Changed status to publish July 16, 2022