Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_printf

🚀 Description

This is the ft_printf project in 42's curriculum. It replicates the behaviour of the printf function in the C programming language. It handles the following conversions and flags:

  1. "cspdiuxX%" conversions.
  2. "0-" flags.
  3. Width and precision (also with the '*' option).

For more information on this function see the manpage of the C printf function.

⚙️ Installation and Setup

Clone this repository and go inside the project folder. Then run:

make

This will create all the object files and the libftprintf.a static library. This library contains the ft_printf function. To delete all the object files and only keep the libftprintf.a library, run:

make clean

🕹️ Usage

To use this function, compile and execute this way:

gcc -Wall -Wextra -Werror your_main.c libftprintf.a
./a.out

In which your_main.c should be something like:

#include "src/ft_printf.h"

int     main(void)
{
    ft_printf("%10.5d\n", 1234567);
    return (0);
}

The results will be printed on stdout.

📘 License

MIT

About

Replicate the C printf function.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages