 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can perform string concatenation using pointers. 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 which is available on Google Play. Now I am going to implement solution of this problem. So first time including a header file that is stdi.h. Now I am defining main function. So inside main function first time declaring character arrays s1 and s2 and I am declaring two pointers p1 and p2. Now with the help of printer the masses enter first string will be displayed on console. The contents of first string will be received through gattus and stored inside s1. Now through second printf the masses enter second string will be displayed on console. And again I am using gattus to read contents of s2 string from user. Now for concatenation purpose first I have to move to the null position of s1. So for that purpose I am assigning base address of s1 into p1. So base address of s1 is assigned into p1 pointer. Now I am implementing a for loop sorry while loop and condition is s risk p1 not equals to null. And inside this loop I am just incrementing p1 by 1. So when p1 pointer will reach to null position then this loop will be terminated. So after this loop I have to copy contents of s2 into s1. So through p1 I am at end of s1 string where null is available. Now I can copy contents of s2 into s1. But for that purpose I have to assign address of s2 into p2. So again here base address of s2 is assigned into p2 pointer. Now again I am implementing while loop. This time condition is s risk p2 not equals to null. So if this condition is true then I have to copy elements of s2 into s1. So I have implemented the statement s risk p1 equals to s risk p2. So s risk p2 is pointing to s2. So elements of s2 will be copied into s1 because p1 is pointing to s1. Now p1 plus plus and p2 plus plus. So this way all the elements of s2 will be copied into s1 but through p1 and p2 pointers. At last when p2 will be pointing to null position this loop will be terminated. So after completion of this loop I have to copy null explicitly in s1 but through p1 pointer. So this way I have concatenated both the strings into s1. Now I can print the result on console using this printf statement and through s1 array. And then return 0. So this way all the elements are available inside s1 that will be printed on console. Now I am executing this code. So in first string I am entering Sanjay and in second I am entering Gupta. You can see the output concatenated string is printing as Sanjay Gupta. So s1 is concatenated. It is containing contents of s1 as well as contents of s2. So this way with the help of pointers I have concatenated contents of two strings into a single string. I hope you have understood the concept well. 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 Tech immense which is available on Google Play. Thank you for watching this video.