Strcpy() function copies the contents of one string into another string. - C String

C examples for String:String Function

Description

Strcpy() function copies the contents of one string into another string.

Demo Code

#include <stdio.h> 
#include <string.h> 
int main()// ww  w  .ja va 2s. co  m
{ 
   char str1[11]; 
   char *str2 = "C Language"; 
   printf("\nString 1 now contains %s\n", strcpy(str1, str2)); 
}

Result


Related Tutorials