Added links to toc

This commit is contained in:
Kyler Olsen 2025-11-27 20:10:12 -07:00
parent 04274e14e3
commit ce0a78b6c6
1 changed files with 16 additions and 23 deletions

View File

@ -14,20 +14,21 @@ A concise, practical reference for terminal (stdin/stdout/stderr) and file I/O i
## Table of contents
1. Overview
2. Streams and `FILE *`
3. Opening and closing streams
4. Formatted I/O (`printf`/`scanf` families)
5. Format specifiers and `inttypes.h`
6. Character I/O
7. Line and block I/O (`fgets`, `fputs`, `fread`, `fwrite`)
8. Buffering and `setvbuf` / `fflush`
9. File positioning (`fseek`, `ftell`, `rewind`)
10. Error handling (`feof`, `ferror`, `clearerr`, `perror`)
11. Temporary files
12. Tips for safe and portable terminal I/O
13. Examples
14. POSIX terminal control (note)
1. [Overview](#1-overview)
2. [Streams and `FILE *`](#2-streams-and-file)
3. [Opening and closing streams](#3-opening-and-closing-streams)
4. [Formatted I/O (`printf`/`scanf` families)](#4-formatted-io-printfscanf-families)
5. [Format specifiers and `inttypes.h`](#6-character-io)
6. [Character I/O](#6-character-io)
7. [Line and block I/O (`fgets`, `fputs`, `fread`, `fwrite`)](#7-line-and-block-io)
8. [Buffering and `setvbuf` / `fflush`](#8-buffering-and-setvbuf-fflush)
9. [File positioning (`fseek`, `ftell`, `rewind`)](#9-file-positioning)
10. [Error handling (`feof`, `ferror`, `clearerr`, `perror`)](#10-error-handling)
11. [Temporary files](#11-temporary-files)
12. [Tips for safe and portable terminal I/O](#12-tips-for-safe-and-portable-terminal-io)
13. [Examples](#13-examples)
14. [POSIX terminal control (note)](#14-posix-terminal-control-note)
15. [Quick reference: common functions](#15-quick-reference-common-functions)
---
@ -329,7 +330,7 @@ Example POSIX-only header include:
---
## Quick reference: common functions
## 15. Quick reference: common functions
* `fopen`, `fclose` — open/close file
* `fread`, `fwrite` — block I/O
@ -341,11 +342,3 @@ Example POSIX-only header include:
* `fseek`, `ftell`, `rewind` — positioning
* `feof`, `ferror`, `clearerr`, `perror` — error handling
* `tmpfile`, `tmpnam` — temporary files
---
If you want, I can:
* Add a printable PDF / cheat-sheet version.
* Expand the POSIX terminal control section with a `termios` example.
* Create a one-page cheat-sheet for printing and scanning format specifiers.