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 firstname.lastname@example.org. 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.
- rename function in C/C++
- Output of C programs | Set 63
- Basics of File Handling in C
- How to print a number 100 times without using loop and recursion in C?
- tmpfile() function in C
- Read/Write structure to a file in C
- fgetc() and fputc() in C
- ftell() in C with example
- Difference between getc(), getchar(), getch() and getche()
- C Language Introduction
- fopen() for an existing file in write mode
- Memory Layout of C Programs
- How does free() know the size of memory to be deallocated?
- fseek() vs rewind() in C
- What is return type of getchar(), fgetc() and getc() ?