 Hello friends, I am Sanjay Gupta. I welcome you on my YouTube channel. You can watch various programming related videos here. My channel contains more than 800 videos. You can search those videos to be worth programming by Sanjay Gupta. In this video, I am going to demonstrate you the implementation of str-alien function as predefined and as user defined. So first I am going to implement str-alien function as predefined variation. So I am going to include two header files. First is str.h and second one is str.h. Now I am going to declare a character array and I have initialized a value in it. That is my name. Then I have declared a variable of integer type that is alien. Now I am going to call str-alien function which is predefined. So it will calculate length of the string and the result will be stored inside alien variable. So I can print that on output screen with the help of printf. So this way I have implemented str-alien as predefined. Now I am going to execute this. So you can see the output. It is showing length equals to 6. So str-alien function basically find out how many characters are available in a string. It doesn't include null character that is represented by backslash 0. So before backslash 0, the characters which are available in the string that is counted through this function. So this was the implementation of str-alien function as predefined. Now I am going to convert it and I am going to implement this str-alien function working as user defined function. So first I have declared a function whose name is x-str-alien. I can't use str-alien because it is already defined. So I have modified this name as x-str-alien. This function will receive an argument of character array type and it will return an integer as output. Here I have to call this function at line number 8. The meaning code will be same. After defining main function I have to implement definition of x-str-alien. So here I have to implement the logic so that I can find out how many characters are available in string str. So here I have declared two variables LAN which is initialized with 0 and then I both are of integer type. So here I have implemented a loop which will count how many characters are available before backslash 0 in the string and calculated value will be available in alien variable. After completion of this loop I can return this variable and the return value will be stored inside alien variable which is available at line number 8. So this way I have implemented the user defined version of str-alien function. So here no need of including string.h header file because I have created the definition or the process for counting how many characters are available in the string. So this way I have implemented the code. Now I am going to execute this so that you can check whether it is working or not properly or not. So it is printing the result as length equals to 6 which is correct. So friends this way I have converted a predefined function process into user defined function. I hope you have understood both the implementation and you might have understood the difference between predefined and user defined implementation of str-alien function. If you want to watch more programming related videos you can follow my YouTube channel. Thank you for watching this video.