Skip to content

ft_printf project to recode original libc printf function.

Notifications You must be signed in to change notification settings

RaulSoftDev/ft_printf

Repository files navigation

ft_printf

ft_printf is a 42 Madrid Common Core project in which you have to recode the libc library printf function.

About the project

ft_printf is a variadic function that will allow you to format any input and send it through the terminal standard output stdout. It means that this function must take a dynamic number of variables and get their values.

Mandatory parts

  • Function protoype: int ft_printf(char const *, ...);
  • It's not necessary to implement the original printf buffer management.
  • Your function will be compared to the original printf.
  • To create your library you must use the ar command. libtool is forbidden.
  • Your libftprintf.a file must be created in the root folder of the project.

Conversions

  • %c for characters.
  • %s for strings.
  • %p for void * pointers.
  • %d for base 10 decimal numbers.
  • %i for base 10 integers numbers.
  • %u for base 10 unsigned decimal numbers.
  • %x for base 16 lowercase hexadecimal numbers.
  • %X for base 16 uppercase hexadecimal numbers.
  • %% for the % character.

Compilation

Requirements

  • C compiler: gcc, cc, etc...
  • make utility.
  • libft library in the project root folder.

Make commands

  • make: compile project.
  • make clean: deletes compilation files except the executables.
  • make fclean: deletes all compilation files.
  • make re: executes make fclean and make.

Build project

  1. Clone the repository:

    git clone https://github.com/RaulSoftDev/ft_printf.git
  2. Build the project:

    make
  3. Use the library in your project:

    #include "ft_printf/libftprintf.h"
  4. Compile your project:

    gcc -Wall -Wextra -Werror *.c ft_printf/libftprintf.a

Releases

No releases published

Packages

No packages published