C program to copy string using Strcpy() function

Copy string using Strcpy() function

This program illustrate the concept to copy string using Strcpy() function. Strcpy() function copies the string to another character array.

Program

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char x[]="Scanfcode";
char y[15];
clrscr();
strcpy(y,x);
printf("%s",y);
getch();
}

OUTPUT:-

copy string


Comment below if you are facing any problem and subscribe to our newsletter for more updates.


Also read

C Program to find Greatest Element in entered array
C Program to search an element in entered array
C program to enter elements in array of your choice
C program to find area of circle of input radius
C program to find string length without using strlen()
C program compare two strings using strcmp function


Summary
C program to copy string using Strcpy() function
Article Name
C program to copy string using Strcpy() function
Description
This program illustrate the concept to copy string using Strcpy() function.
Author
Publisher Name
Scanfcode
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *