Skip to content

forzen03/ft_printf

Repository files navigation

ft_printf

A custom implementation of the C standard library function printf(), built from scratch as part of the 42 School curriculum.

About

ft_printf is a project that replicates the behavior of the standard printf function. It parses a format string and handles variadic arguments to produce formatted output to standard output. The project is built on top of libft, a custom C utility library.

Supported Format Specifiers

Specifier Description
%c Prints a single character
%s Prints a string (prints (null) if NULL)
%p Prints a pointer address in hexadecimal with 0x prefix (prints (nil) if NULL)
%d Prints a signed decimal integer
%i Prints a signed decimal integer
%u Prints an unsigned decimal integer
%x Prints a number in lowercase hexadecimal
%X Prints a number in uppercase hexadecimal
%% Prints a literal % character

Getting Started

Prerequisites

  • GCC or CC compiler
  • Make

Installation

git clone https://github.com/forzen03/ft_printf.git
cd ft_printf
make

Usage

Include the header in your C files and link the library when compiling:

#include "ft_printf.h"
cc your_file.c -L. -lftprintf -o your_program

Clean Up

make clean    # Remove object files
make fclean   # Remove object files and the library
make re       # Rebuild everything

Author

njaradat@forzen03

About

Custom C implementation of printf() — 42 School project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors