by Dinesh Thakur

The program implements the Copy string to another string. The inner function “stcpy” takes 2 string pointers as arguments. “copystr” pointer type function declared and pointer type char variable declare. On next move the argument written “I am Dinesh Thakur” in the variable char pointer type and array type string variable. The required function used “cpystr”.

In the next move void copystr() and pointer type two variable dest ,src. While condition src!=0 then dstn=src then the string will be copied in dest then return the result as copied string.
Problem Statement:- 
This program User asks to Copy String from one To another string with the Help of Pointer.

  1. Declare pointer type variable.
  2. Using While Statement.
  3. Display result on the screen.

This C program is successfully compiled and run on a System. Output is shown below


void copystr(char*,char*);
void main()
             char*str1="I am Dinesh Thakur";
             char str2[30];
             printf("\n %s",str2);
            void copystr(char *dest,char *src)
Output :
I am Dinesh Thakur