Skip to content

ylam21/ft_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ft_printf

This project is part of the 42 Prague curriculum.
The goal of ft_printf is to reimplement the standard C printf function.
It is a key project for learning about variadic functions, formatted output, and modular design in C.

πŸ“¦ Installation & Compilation

  1. Clone the repository:
git clone git@github.com:ylam21/ft_printf.git ft_printf
cd ft_printf
  1. Compile the library:
make

This will produce the libftprintf.a static library.

πŸš€ Usage

  1. Include the header in your source file:
#include "ft_printf.h"
  1. Compile your program with the library:
gcc -Ift_printf your_program.c -Llibft -lft -o a.out

-Ift_printf tells the compiler where to find ft_printf.h

-Llibft tells the linker where to find libftprintf.a

-lft links the library

🧹 Makefile Rules

make – Compile the library

make clean – Remove object files (.o)

make fclean – Remove object files and the compiled library (libft.a)

make re – Recompile everything (equivalent to fclean + make)

πŸ§ͺ Tests

A collection of tests is included in the tests/ folder.

Build the tests

make tests

This compiles all test programs into the tests_bin/ directory.

Run all tests

make run_tests

Each test binary will execute, printing results to the console.

Clean test binaries

make clean_tests

πŸ“ Notes

The project is built on top of your libft library.

Functions follow the 42 norminette coding standard.

ft_printf is often reused in future projects (e.g., cub3d, minishell).

About

My implementation of printf function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published