 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you the use of fseq function 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. My channel will be available there. You can watch various programming related videos there. Now I am going to implement a code in C programming for demonstrating the use of fseq. So first of all, I have included two header files stdio.h and stdlib.h. Now I am going to define main function. Inside main function, I have declared a file pointer that is fp and a character variable ch. Now I am going to open a file that is demo.txt and I am going to open it in read mode. So after opening the file, I am going to check this if condition, whether file pointer is containing null or not. So if file pointer is containing null, it means file is not open successfully. So the error message cannot open file will be printed and exit will be terminating execution of the program. Otherwise the statements which are available after if will be executed. So first I am going to show you the demo.txt. It will be available in this path that is ctcbin. Because I have saved this test.c file in bin folder. So this demo.txt must be available in this path only. So I am opening ctcbin. Here you can see demo.txt is already available. And it is containing my name that is Sanjay Gupta without any space. So Sanjay is containing six letters and Gupta is containing five letters. So after execution of this program, I will be displaying only Gupta on output screen. So I have to reach to this position that is after y and before g. And I will reach to this position with the help of fc function. So I have closed this file and I am moving to the source code. So here I have to use fc function so that I can move to that particular position from that position. I have to print the values or I have to read the content. So before using fc you have to understand its declaration. So fc requires three arguments. First is file pointer. Second one is offset and third one is origin. So file pointer belongs to the particular file from where we want to read the content or we want to write the content. So fc will search a particular position in that file with the help of file pointer. Offset indicates how many letters or characters you want to skip. And origin is the originate point that from where you want to skip or you want to start skipping the content. So there are three origins. C underscore set that is beginning of file C underscore C bar that is current position of the file and C underscore and the notes end of file. And all these origins are predefined. So if you want to skip content from beginning then you have to use C underscore set. If you want to skip the content from the current position then C underscore C bar otherwise C underscore end. So now in this program I am opening file in read mode. So the five pointer will be at beginning of the file. So I will be using C underscore set because I have to skip the content from the beginning of the file and I have to skip six letters. So this way I have called fc function which will skip six letters from the file and then I can read the content. So here I am calling fqr function which will check whether the file pointer is at end of file or not. Now with the help of fgetc I am going to read characters from the user and those entered characters will be displayed on output screen. So this way I have implemented while loop which will read the data from the current position till end of file. So the current position is changed now with the help of fc. It is not the beginning of file. It is somewhere in the middle of the file. After completion of this loop I can close the file with the help of fclose. So this way I have implemented the use of fc function in this program. Now we have to execute this code so that you can understand whether the program is working properly or not. So I have executed the code. You can see the output. It is showing Gupta only. I have not entered anything while executing this code. It is reading the content from file and it is showing the received content on output screen. So I hope you have understood how I have used fc function to read only a part of the content from the file. I have shifted on seventh position of the file with the help of this fc function because I have skipped six positions. And the beginning position is c underscore set that is beginning of file. So this way I have applied fc function to move the file pointer at the desired position as per the user's requirement. I hope you have understood whatever I have demonstrated you in this video. 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 here. Thank you for watching this video.