Learning C
This repository contains my notes, exercises, and code while learning C programming.
Antirez Course - Impariamo il C
Course by Salvatore Sanfilippo (antirez).
Fondamenti
- Lezione 1: Introduzione
- Lezione 2: Variabili e operatori
- Lezione 3: Variabili Globali
- Lezione 4: Tipi
- Lezione 5: Stringhe
Controllo di Flusso e Ricorsione
- Lezione 6: IF, GOTO e ricorsione
- Lezione 7: Ancora sulla ricorsione, while/for, switch
- Lezione 8: Implementiamo il Conway’s Game of Life
Puntatori
- Lezione 9: Introduzione ai puntatori
- Lezione 10: La matematica dei puntatori
- Lezione 11: Chiarimenti sui puntatori
- Lezione 12: Un primo incontro con malloc()
- Lezione 13: Il trucco dei metadati nascosti
Strutture Dati
- Lezione 14: Le strutture del C
- Lezione 15: Le struct come mattone delle strutture dati
- Lezione 16: Stringhe con reference counting
- Lezione 17: Design delle stringhe, hexdump()
- Approfondimento: Reference counting
Concetti Avanzati
- Lezione 18: Tipi opachi, typedef, file stdlib
- Lezione 19: Le chiamate di sistema
- Lezione 20: Buffering della libc e file mappati in memoria
- Lezione 21: Union e bitfield
- Lezione 22: I puntatori a funzione
- Lezione 28: Funzioni con numero variabile di argomenti
Progetto: Toy Forth
- Lezione 23: Interprete Toy Forth (parte 1)
- Lezione 24: Interprete Toy Forth (parte 2)
- Lezione 25: Interprete Toy Forth (parte 3)
- Lezione 26: Toy Forth - exec() (parte 4)
- Lezione 27: Toy Forth - registrazione funzioni (parte 5)
- Lezione 29: Toy Forth - primo programma
Puntate Speciali
K&R Exercises
Exercises from “The C Programming Language” by Kernighan and Ritchie.
- Chapter 1: A Tutorial Introduction
- Chapter 2: Types, Operators and Expressions
- Chapter 3: Control Flow
- Chapter 4: Functions and Program Structure
- Chapter 5: Pointers and Arrays
- Chapter 6: Structures
- Chapter 7: Input and Output
- Chapter 8: The UNIX System Interface
Exercises
Practice exercises and notes on pointers, linked lists, and more.
Notes
Source Code
- circular_list.c - Circular linked list
- libri.c - Book management with structs
- remove_emoji.c - Remove emoji from strings
- rubrica.c - Phone book with doubly linked list
Compilation
gcc -o program program.c
./program
With warnings enabled (recommended):
gcc -Wall -Wextra -o program program.c