C – Strcpy

C – Strcpy 2017-08-06T09:01:00+00:00

Strcpy :

strcpy (str1,str2) copies the string pointed to by str2 to the string pointed to by str1 and terminates str1 with a null. The str2 must be a pointer to a null terminated string.

Syntax :
#include<string.h>
char *strcpy( char *to, const char *from );

C – STRCPY EXAMPLE PROGRAM :

Output :

Before :

str1 : cprogrammingexpert

str2 : .com

After

str1 : .com

str2 : .com

 

Prev Next