Skip to content

Nipsu24/42_ft_printf

Repository files navigation

ft_printf

Hive Helsinki (School 42) second curriculum project (Rank01)

About

The repository contains a custom made printf function derived from the C standard library. The buffer management of the original function is not taken into consideration within this implementation. The following conversions are covered: [c, s, p, d, i, u, x, X, %]. Being the second project in the 42 school's curriculum, it intends to familiarize oneself with the concept of variadic functions in C. The resulting function is used in the course of future school projects written in C language.

Function

The function is able to print with the following conversions:

  • c (characters)
  • s (strings)
  • p (addresses)
  • d/i (integers)
  • u (unsigned integers)
  • x (hexadecimal lower case)
  • X (hexadecimal upper case)
  • % (prints '%')

Requirements

-gcc compiler with <stdlib.h> and <stdarg.h>

Instructions

1. Compiling the printf library

To compile the printf library, go to its path and run:

$ make

2. Cleaning all binary (.o) and executable files (.a)

To delete all files generated with make, go to the path and run:

$ make fclean

3. Using it in your code (basic example)

To use the function, include the header path e.g in your main.c file (given printf is in the main's folder):

#include "ft_printf.h"

compile printf as stated above, then compile the actual program:

gcc main.c libft/libft.a libftprintf.a

Releases

No releases published

Packages

No packages published