</>CodexBash
All tutorials

C tutorial

Close to the machine. Learn what memory, pointers and types really are.

  1. 01Your first C programWhat C is, the shape of every C program, compiling and running with gcc, printing with printf, and reading compiler errors.9 min
  2. 02Variables and data typesDeclaring variables, C's number and character types and their sizes, overflow, sizeof, constants, and converting between types.11 min
  3. 03Operators and expressionsArithmetic and integer division, remainder with negative numbers, increment and decrement, comparisons, logical operators with short-circuiting, and precedence.9 min
  4. 04Input, output and stringsReading numbers and words with scanf, strings as character arrays ending in a null byte, the string.h functions, and the safe way to read a line.12 min
  5. 05Decisions with if, else and switchChoosing what runs with if, else if and else, why braces matter, the ternary operator, and switch for one value compared against many.9 min
  6. 06Loops with for, while and do whileCounting loops with for, condition loops with while and do while, break and continue, nested loops, and the off-by-one errors that cause most loop bugs.10 min
  7. 07Functions and pointers to variablesWriting functions with parameters and return types, prototypes, why arguments are copies, and using pointers to let a function change a caller's variable.12 min
  8. 08Arrays, and allocating memoryDeclaring and initialising arrays, why an array forgets its length when passed to a function, two-dimensional arrays, and allocating arrays at run time with malloc and free.12 min