The fsetpos() function moves the file position indicator to the location specified by the object pointed to by position. When fsetpos() is executed ,the end-of-file indecator is reset.
int fsetpos(FILE *stream, const fpos_t *position)
- stream – This is the pointer to a FILE object that identifies the stream.
- position – This is the pointer to a fpos_t object containing a position previously obtained with fgetpos.
Return – If it successful, it return zero otherwise returns nonzero value.
This article is contributed by Shivani Ghughtyal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- C program to copy contents of one file to another file
- C program to check whether the file is JPEG file or not
- How to get the current position of cursor from output screen in C?
- Comment in header file name?
- C | File Handling | Question 5
- C | File Handling | Question 4
- C | File Handling | Question 3
- C | File Handling | Question 2
- C | File Handling | Question 1
- What is data type of FILE in C ?
- How to write your own header file in C?
- Basics of File Handling in C
- C program to delete a file
- time.h header file in C with Examples
- C Program to find size of a File
- LEX program to add line numbers to a given file
- Read/Write structure to a file in C
- C Program to print contents of file
- Print "Hello World" in C/C++ without using any header file
- Four File Handling Hacks which every C/C++ Programmer should know