← All lectures

Lecture 26 · 35 min

File Handling — Pointers, Modes & Binary

Get / put pointers, seekg / seekp, binary file I/O with read() and write(), and the difference between text and binary modes.

File pointersseekg / seekpBinary filesread / write
Slide 1 / 16

Streams — a quick recap

A stream is like a pipe: data flows through it between your program and a device (keyboard, screen, file, network).

C++ ships with:

  • cin — input from keyboard
  • cout — output to screen
  • cerr — error messages to screen
  • File streams from <fstream> — read from / write to disk files
← / → navigateF fullscreenEsc exit⌘K search