 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use Fputter's function that is available in file handling in C programming. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube search. My channel will be available there. You can watch various programming related videos here. Now I am going to demonstrate you how you can read a line of text from user and how you can store it into a file with the help of Fputter's function available in C programming. So first I am including a header file that is stdio.h, then another header file that is a std liv.h. Now I am going to define main function. Inside main function, I am declaring a file pointer that is fp. Then I am declaring a character array. Now I am going to open a file in which I am going to store the line of text entered by the user. So name of file will be line.txt and I am going to open it in w mode. That is write mode. Now I have to check whether the file is opened successfully or not. So if condition is fp.w equals to null. So if file pointer is containing null, it means file is not opened successfully. So I can print an error message that cannot open file and I am calling exit function so that execution of the program can be terminated. Now after this operation, I am going to display a message on the output screen. Enter a line of text. I am going to read that line of text through GATUS and that line of text will be stored inside str. I am increasing the size of this str250. So str will be containing line of text that will that will be entered by the user. Now I have to store that line of text into a file. So I am calling fputus. fputus is a predefined function that stores string into a file. So here I have to pass two arguments str and then file pointer. So it stores string into a file. Then fclose fp and then return 0. So now I have to check whether this line.txt is available or not available or not because if it is not available then w will be creating this file automatically. So my source code is saved in c drive tc bin folder with test.c name. So this line.txt must be available in this path only. So I am moving to that path that is c, tc and bin. Here I have to check whether the line.txt is available or not. So I am pressing L. So there is no file who is starting with L name. So line.txt is not available here. Now I have to execute this code so that this line.txt will be created automatically. Then after execution program will ask that I have to enter a line of text after entering the line of text it will be automatically stored into a file. So now I am going to execute this code. You can see it is asking for a line of text. So I am entering India is my country and I am pressing enter key. So program has executed completely. Now again I have to move to the bin folder. So I am right now in bin folder again I am pressing L. You can see this time a single file that is line.txt is available. I am double clicking on this file. You can see it is having India is my country. So the text which I have entered while execution of the program is available in this file. It means Fputus is successfully writing the content which is received from the user. Now again I am going to execute this code. This time again it is asking for a line of text. This time I am entering I love India and I am pressing enter key. So let's check what happens now again I am opening line.txt. You can see this time it is having I love India. So previous contains have erased automatically and new content is available here. So this is because I am using W mode. W overwrites previous contains automatically. If if you want to keep previous contains then you have to use a mode instead of W. So this way I have demonstrated you how you can use Fputus function to write strings into a file. I hope you have understood how we can use Fputus function in file handling in C programming. If you want to watch more programming related videos you can search my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos there. You can also download my Android app Takamis. Thank you for watching this video.