The fseek in c is a built-in function that allows the programmer or developer to move the file pointer to a specific location within a file. The function is declared in the stdio.h header file in the c programming language. Syntax of fseek() in C The syntax of Fseek in C is given ...
Here, we are going to learn about the fseek() function of library header stdio.h in C language with its syntax, example.
The syntax for the fseek function in the C Language is:int fseek(FILE *stream, long int offset, int whence);Parameters or Argumentsstream The stream whose file position indicator is to be modified. offset The offset to use (in bytes) when determining the new file position. whence It can ...
Library Standard C Library (libc.a) Syntax #include <stdio.h> int fseek (Stream,Offset,Whence) FILE *Stream; long intOffset; intWhence; void rewind (Stream)FILE *Stream; long int ftell (Stream)FILE *Stream; int fgetpos (Stream,Position)FILE *Stream;fpos_t *Position; int fsetpos (Strea...
Syntax fseek(fileID,offset,origin) status = fseek(___) Description fseek(fileID,offset,origin)sets the file position indicatoroffsetbytes fromoriginin the specified file. example status = fseek(___)returns0when the operation is successful. Otherwise,fseekreturns-1. Use any of the previous inpu...
SyntaxC Kopija int fseek( FILE *stream, long offset, int origin ); int _fseeki64( FILE *stream, __int64 offset, int origin ); Parametersstream Pointer to FILE structure.offset Number of bytes from origin.origin Initial position.Return value...
In dit artikel Syntax Remarks See also SyntaxC Kopiëren #include <stdio.h> RemarksThe origin argument specifies the initial position and can be one of the following manifest constants:Tabel uitvouwen ConstantMeaning SEEK_END End of file SEEK_CUR Current position of file pointer SEEK_...
fseek() in C language is used to move file pointer to a specific position. Offset and stream are the destination of pointer, given in the function parameters. If successful, it returns zero, else non-zero value is returned. Here is the syntax of fseek() in C language, ...
Syntax: intfseek(FILE*stream,longintoffset,intwhence) There are 3 constants used in the fseek() function for whence: SEEK_SET, SEEK_CUR and SEEK_END. Example: #include <stdio.h> voidmain(){ FILE*fp; fp = fopen("myfile.txt","w+"); ...
Syntax fseek(fileID,offset,origin) status = fseek(___)Description fseek(fileID,offset,origin) sets the file position indicator offset bytes from origin in the specified file. example status = fseek(___) returns 0 when the operation is successful. Otherwise, fseek returns -1. Use any of ...