Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

512 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holberton School — Low-Level Programming in C

Language Standard Style

Projects completed during the low-level programming track of Holberton School. Starting from "Hello, World", the curriculum works down to how C programs are compiled, how memory is laid out and managed, and how classic data structures and algorithms are built from scratch — without relying on the standard library where possible.

Table of contents

Projects

Project Topic Key concepts
0x00 Hello, World Compilation stages, gcc, puts/printf, type sizes
0x01 Variables, if, else, while Control flow, loops, ASCII, putchar
0x02 Functions, nested loops Prototypes, header files, nested loops
0x03 Debugging Test cases, edge cases, fixing logic errors
0x04 More functions, more nested loops Drawing shapes, printing numbers digit by digit
0x05 Pointers, arrays and strings Pointers, arrays, null-terminated strings, atoi
0x06 More pointers, arrays and strings strcat/strcmp, ROT13, arbitrary-precision add, hex dump
0x07 Even more pointers, arrays and strings memset/memcpy, string search, 2D arrays, double pointers
0x08 Recursion Base/recursive cases, palindromes, wildcard matching
0x09 Static libraries ar, ranlib, linking with -L/-l
0x0A argc, argv Command-line arguments, input validation
0x0B malloc, free Heap allocation, 2D grids, valgrind
0x0C More malloc, free exit, calloc, dynamic ranges
0x0D Preprocessor Macros, include guards, predefined macros
0x0E Structures, typedef struct, typedef, deep copies
0x0F Function pointers Callbacks, dispatch tables, calculator
0x10 Variadic functions stdarg.h, va_list, format-driven printing
0x12 Singly linked lists Nodes, traversal, insertion, freeing
0x13 More singly linked lists Indexed insert/delete, pop, sum
0x14 Bit manipulation Binary conversion, get/set/clear bits, endianness
0x15 File I/O open/read/write/close, permissions, cp clone
0x17 Doubly linked lists prev/next links, indexed insert/delete
0x18 Dynamic libraries -fPIC, -shared, LD_LIBRARY_PATH, Python ctypes
0x1A Hash tables djb2, chaining, sorted hash table
0x1C Makefiles Rules, targets, variables
0x1E Search algorithms Linear, binary, jump, interpolation, exponential, Big O

Each project directory has its own README.md with learning objectives, the list of tasks and their prototypes, and a compilation example.

Requirements

  • OS: Ubuntu 20.04 LTS
  • Compiler: gcc with the flags -Wall -Werror -Wextra -pedantic -std=gnu89
  • Style: Betty (Linux-kernel-like style, documented functions, max. 40 lines per function and 5 functions per file)
  • No global variables
  • Prototypes of every function are declared in the project's header file (main.h, lists.h, hash_tables.h, ...), protected by include guards
  • Where printf is not allowed, output goes through _putchar, a one-line wrapper around write(2)

Getting started

git clone https://github.com/pipeleon/holbertonschool-low_level_programming.git
cd holbertonschool-low_level_programming/0x08-recursion

# Compile a task together with its test driver
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 _putchar.c 0-main.c 0-puts_recursion.c -o 0-puts_recursion
./0-puts_recursion

Projects that work with dynamic memory are best checked with valgrind:

valgrind --leak-check=full ./program

Repository structure

0xNN-project_name/
├── README.md        # project description, tasks and usage
├── main.h           # prototypes (or lists.h, dog.h, hash_tables.h, ...)
├── N-task_name.c    # solution to task N (100+ are advanced tasks)
├── N-main.c         # test driver for task N (provided by Holberton)
└── _putchar.c       # write(2)-based character output, when needed
  • Files are named after their task number: 0-… to N-… are mandatory tasks, 100-… and above are advanced tasks.
  • Each source file starts with a /* Task N 0xNN. ... */ line and every function has a Betty-style documentation block describing its parameters and return value.

Author

pipeleon — github.com/pipeleon

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages