STRCPY() FUNCTION

The strcpy() function copies the string to the another character array.

Syntax:


char* strcpy(char* destination, char* source);

The strcpy() function copies the string pointed by source (including the null character) to the character array destination. This function returns character array destination.


1A_Pro19: W.A.P. to perform strcpy() function on string.

#include<stdio.h>
#include<string.h>
void main()
{
          char str1[10]="awesome";
          char str2[10];
          char str3[10];
          clrscr();
          strcpy(str2, str1);
          strcpy(str3,"well"); 
          puts(str2);
          puts(str3);
          getch();
}

Output: