Storage manager function to implement read operations on a file -



Storage manager function to implement read operations on a file -

how adapt programme perform next operations:

1.to read first block of file 2.to read current block of file 3.to read previous block of file 4.to read next block of file 5.to read lastly block of file next code written me read info file using file pointer , want implement above operations

void main() { file *fptr; char filename[15]; char ch; printf("enter filename opened \n"); scanf("%s", filename); /* open file reading */ fptr = fopen(filename, "r"); if (fptr == null) { printf("cannot open file \n"); exit(0); } ch = fgetc(fptr); while (ch != eof) { printf ("%c", ch); ch = fgetc(fptr); } fclose(fptr); }

any suggestions helpful.

file storage fread filehandle fseek

Comments

Popular posts from this blog

php - How to pass multiple values from url -

php - Laravel not returning controller -

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates -