Book Description
This is an intro to C for folks who already know how to program in another language. The first half of the book is written in a tutorial style, while the second half is a reference section complete with examples (inspired by the incomparable Turbo C Bible). The goal is to keep this up-to-date with the latest C standards.
This guide assumes that you've already got some programming knowledge under your belt from another language, such as Python, JavaScript, Java, Rust, Go, Swift, etc. (Objective-C devs will have a particularly easy time of it!)
This open book is licensed under a Open Publication License (OPL). You can download Beej's Guide to C Programming ebook for free in PDF format (4.3 MB).
Table of Contents
Chapter 1
Foreword
Chapter 2
Hello, World!
Chapter 3
Variables and Statements
Chapter 4
Functions
Chapter 5
Pointers - Cower In Fear!
Chapter 6
Arrays
Chapter 7
Strings
Chapter 8
Structs
Chapter 9
File Input/Output
Chapter 10
typedef: Making New Types
Chapter 11
Pointers II: Arithmetic
Chapter 12
Manual Memory Allocation
Chapter 13
Scope
Chapter 14
Types II: Way More Types!
Chapter 15
Types III: Conversions
Chapter 16
Types IV: Qualifiers and Specifiers
Chapter 17
Multifile Projects
Chapter 18
The Outside Environment
Chapter 19
The C Preprocessor
Chapter 20
structs II: More Fun with structs
Chapter 21
Characters and Strings II
Chapter 22
Enumerated Types: enum
Chapter 23
Pointers III: Pointers to Pointers and More
Chapter 24
Bitwise Operations
Chapter 25
Variadic Functions
Chapter 26
Locale and Internationalization
Chapter 27
Unicode, Wide Characters, and All That
Chapter 28
Exiting a Program
Chapter 29
Signal Handling
Chapter 30
Variable-Length Arrays (VLAs)
Chapter 31
goto
Chapter 32
Types Part V: Compound Literals and Generic Selections
Chapter 33
Arrays Part II
Chapter 34
Long Jumps with setjmp, longjmp
Chapter 35
Incomplete Types
Chapter 36
Complex Numbers
Chapter 37
Fixed Width Integer Types
Chapter 38
Date and Time Functionality
Chapter 39
Multithreading
Chapter 40
Atomics
Chapter 41
Function Specifiers, Alignment Specifiers/Operators
Chapter 42
<assert.h> Runtime and Compile-time Diagnostics
Chapter 43
<complex.h> Complex Number Functionality
Chapter 44
<ctype.h> Character Classification and Conversion
Chapter 45
<errno.h> Error Information
Chapter 46
<fenv.h> Floating Point Exceptions and Environment
Chapter 47
<float.h> Floating Point Limits
Chapter 48
<inttypes.h> More Integer Conversions
Chapter 49
<iso646.h> Alternative Operator Spellings
Chapter 50
<limits.h> Numeric Limits
Chapter 51
<locale.h> locale handling
Chapter 52
<math.h> Mathematics
Chapter 53
<setjmp.h> Non-local Goto
Chapter 54
<signal.h> signal handling
Chapter 55
<stdalign.h> Macros for Alignment
Chapter 56
<stdarg.h> Variable Arguments
Chapter 57
<stdatomic.h> Atomic-Related Functions
Chapter 58
<stdbool.h> Boolean Types
Chapter 59
<stddef.h> A Few Standard Definitions
Chapter 60
<stdint.h> More Integer Types
Chapter 61
<stdio.h> Standard I/O Library
Chapter 62
<stdlib.h> Standard Library Functions
Chapter 63
<stdnoreturn.h> Macros for Non-Returning Functions
Chapter 64
<string.h> String Manipulation
Chapter 65
<tgmath.h> Type-Generic Math Functions
Chapter 66
<threads.h> Multithreading Functions
Chapter 67
<time.h> Date and Time Functions
Chapter 68
<uchar.h> Unicode utility functions
Chapter 69
<wchar.h> Wide Character Handling
Chapter 70
<wctype.h> Wide Character Classification and Transformation
Chapter 71
Exercises