Skip to content
doubtly

2 answers

Answer: Disk I/O functions are the C library functions that read data from and write data to files stored on a disk (secondary storage).

In C, input/output functions are of two kinds: console I/O (keyboard and screen) and disk (file) I/O. Disk I/O functions work through a file pointer FILE * declared in stdio.h, so data is stored permanently.

  • Opening and closing: fopen(), fclose()
  • Character I/O: fgetc() / getc(), fputc() / putc()
  • String I/O: fgets(), fputs()
  • Formatted I/O: fscanf(), fprintf()
  • Record (block) I/O: fread(), fwrite()
  • Positioning: fseek(), ftell(), rewind()
FILE *fp = fopen("data.txt", "w");
fprintf(fp, "%d\n", 25);
fclose(fp);
Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.