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 -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -