C: Programming Close to the Machine

Shriira Press

Preface

Learn C from the ground up — the small, fast language the rest of computing is built on.

Welcome to C: Programming Close to the Machine.

C is fifty years old and still runs the world — operating systems, databases, embedded devices, and the interpreters of newer languages. This free, example-driven book teaches it from first principles: compiling and running programs, the type system and operators, control flow and functions, and then the heart of C — pointers and manual memory management, the stack and the heap — followed by arrays and strings, structs, the preprocessor and multi-file builds, the standard library, and the undefined behaviour every C programmer must respect. Eleven focused chapters with standard, compilable code and clear diagrams. Learn C and you don't just learn a language — you learn how computers actually work.

This title is part of the ShriIra library and is free to read in full, right here — our small contribution to making world-class knowledge easy to reach.

A note on reading it: open the Contents menu at the top of the reader to jump between chapters, use the Aa menu to set a comfortable text size, theme (light, sepia, or night), and single- or two-page layout. Your place is saved automatically, so you can always pick up where you left off.

We hope it serves you well.

— Shriira Press

Contents

  1. Chapter 1 — What C Is and Why It Endures
  2. Chapter 2 — Compiling and Running C
  3. Chapter 3 — Variables, Types, and Operators
  4. Chapter 4 — Control Flow
  5. Chapter 5 — Functions
  6. Chapter 6 — Pointers: The Heart of C
  7. Chapter 7 — Arrays and Strings
  8. Chapter 8 — Memory: The Stack, the Heap, and malloc
  9. Chapter 9 — Structs, Unions, and Enums
  10. Chapter 10 — The Preprocessor and Multi-file Programs
  11. Chapter 11 — Undefined Behaviour, Pitfalls, and Good Practice
0%
1/1