Computer Science, asked by karthikpandu7195, 1 year ago

Function that allow us to access a file in non sequential or random manner

Answers

Answered by Anonymous
0

Answer:

There is no need to read each record sequentially, if we want to access a particular record.C supports these functions for random access file processing.

fseek()

ftell()

rewind()

Explanation:

1) fseek( p,10L,0)

0 means pointer position is on beginning of the file,from this statement pointer position is skipped 10 bytes from the beginning of the file.

ftell()

This function returns the value of the current pointer position in the file.The value is count from the beginning of the file.

Syntax: ftell(fptr);

Where fptr is a file pointer.

rewind()

This function is used to move the file pointer to the beginning of the given file.

Syntax: rewind( fptr);

Where fptr is a file pointer.

Similar questions