Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 3.17 KB

README.md

File metadata and controls

67 lines (40 loc) · 3.17 KB

42cursus-01-Printf

📚 About the project

This project aims to recreate the behavior of printf, including it's basic error handling and some of it's flags. We mainly learning about variadic arguments.

Score

thumbnail_IMG_9161

⚠️ Mandatory

  • Your function has to handle the following conversions: <cspdiuxX%>
  • Flags <-O.*> and minimum field width with all conversions

Functions in <ft_print_hex.c>

  • <%x> || <%X>: ft_print_hex - prints a number in hexadecimal format in lowercase and uppercase

Functions in <ft_print_pointer.c> (and auxiliary functions)

Functions in <ft_print_unsig.c> (and auxiliary functions)

Functions in <ft_printf.c>

  • ft_printf - initialization function: start/end variable argument functions where argument numbers are undefined
  • ft_format - checks each format specifier and calls as functions according to the collected format specifiers.

Functions in <ft_putchar.c>

  • <%c>: ft_putchar - writes a specified character to the output unit provided

Functions in <ft_putnbr.c> (and auxiliary functions)

  • <%i> || <%d>: ft_putnbr - prints the characters representing the numbers

Functions in <ft_putstr.c>

  • <%s>: ft_putstr - writes the string to the given output unit

Makefile

💻 Compiling the project

The library is written in C language and thus needs the -cc compiler and some standard C libraries to run.

Instruction

  1. Compiling the project

      $ make
      $ make fclean
    

    thumbnail_image2

  2. Execute your program

      $ cc ft_printf.c ft_putchar.c ft_putstr.c ft_print_unsig.c ft_print_pointer.c ft_print_hex.c ft_putnbr.c && ./a.out
    

    thumbnail_image1

🐞 Testing

Third-party testers used in the project