 Hello friends. I am Sanjay Gupta. In this video, I am going to demonstrate you how you can copy contents of a string into another by passing string into function. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL, youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimace that is available on Google Play. Now I am going to implement the solution of this problem with the help of C programming. So first time including a header file that is STDI dot h. Now I am defining a function. Sorry, I am declaring a function that is copy and its written type is void. It will receive two arguments that are character arrays. So this statement is function declaration. After this function declaration, I am going to define main function. So inside main, I am declaring two character arrays as one and as two. After this declaration, first I am going to print a message on console enter string. So through GATUS, I am going to read the content provided by the user and all the contents will be stored inside S1 string. Now I am going to call copy function where I will be passing S2 and S1 strings. So this statement is function calling and here S2 here S2 is target string and S1 is source string. So it means content of S1 will be copied into S2. Now I am going to display content of S2 with the help of GATUS and then at last I am writing return 0. So this way content of S1 will be copied into S2 and the result will be displayed on console with the help of GATUS. Now I am going to define definition of copy function. So it is receiving two arguments inside S1 and S2 character arrays. This block is known as function definition. Now inside this function, I am declaring a variable I. Now I am applying a for loop which is initialized with 0. Here I am applying condition S1 of I not equals to null. So if this condition is true then only loop will repeat otherwise it will be terminated and here I am assigning content of S1 into S2 string with this statement. So S1 of I index value will be assigned into S2 of I. After completion of this loop, I have to assign null character into S2 string because whenever we are executing this loop, S1 will not be copied because when null will be available, this loop will be terminated. So S1 will not copy null character into S2. So after completion of this loop, I have explicitly copied null character into S2 string. Now you have to remember that whenever we modify content of array in function definition, its original array will be modified automatically. Here I have to use S2 and S1. So you can see from calling statement S2 string is passed. So that will be received in definition into S2 character array and S1 which is passed from function calling will be received inside S1. So I have copied values of S1 into S2. So S2 is modified in function definition but at function calling the original S2 will be modified automatically. So this is the rule in C programming. Whenever in function definition, formal argument that is character array is modified, its original argument which is available in function calling will be modified automatically. So that's why I can write put as S2 statement inside main function. Otherwise, I have to write this put as S2 statement inside copy function definition. Now I am executing this code. I am entering Sanjay. So you can see the output Sanjay is displayed on console. So I have received input inside S1 but I have displayed S2 on console. So S2 is printing the content which is available inside S1. So this is the reason that we can say the values of S1 has been copied into S2 with the help of this function definition. I hope you have understood whatever I have demonstrated in this video. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimage which is available on Google Play. Thank you for watching this video.