pTutorial

New way to learn C programming

C Program to copy string

These programs copy the one string to the other string that means one array of a char variable to the other array of char using strcpy and without strcpy. You can see all the code below and also download this code.

Copy from one string to another

#include <stdio.h>
#include <conio.h>
void main()
{
  char z[90], x[90];
 
   printf("Enter 1st string\n");
   gets(z);

   strcpy(x, z);
   printf("Entered string: %s\n", z);
   printf("Copied string: %s\n", x);
 
 getch();  
}

Download Copy String Program

Output of program

 C program copy string

strcpy function simply copies the value of string z into the x.

See Also

Jquery submit form by enter button   |   Php 5 tutorial pdf   |   Form validation checking for all number jquery

QUOTES OF THE DAY

A good beginning makes a good ending.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER