josephcheel / 42-Ft_Printf

Recoded Printf function from Libc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ft_Printf |  42 Cursus Complete

Recoded Printf function from Libc. And learn about variadic functions.

What is the project about

This project has two parts organized in two level of difficulty: the mandatory and the bonus part. Mandatory only manages character, string, pointer, decimal, interger, unsigned decimal, hexadecimal and % sign. Bonus part requires to manage -0.# + flags. ft_printf project aims on learning the logic of having an unspecified number of arguments or variadic functions.

General Instrucctions

  • The project must compile with a Makefile without relinking.
  • Makefile has to contain at least this rules: $(NAME), all, clean, fclean and re
  • The project must compile with -Wall -Wextra -Werror flags.
  • After compiling a library named libftprintf.a file has to appear.

To compile the project

> make
> gcc main.c libftprintf.a
> ./a.out

Mandatory Instrucctions

Requirements

Prototype of the ft_printf function: int ft_printf(const char *, ...);

The Mandatory implements the following conversions:

  • %c Prints a single character.
  • %s Prints a string (as defined by the common C convention).
  • %p The void * pointer argument has to be printed in hexadecimal format.
  • %d Prints a decimal (base 10) number.
  • %i Prints an integer in base 10.
  • %u Prints an unsigned decimal (base 10) number.
  • %x Prints a number in hexadecimal (base 16) lowercase format.
  • %X Prints a number in hexadecimal (base 16) uppercase format.
  • %% Prints a percent sign.

Here are the requirements: • You must use the command ar to create your library. Using the libtool command is forbidden. • Your libftprintf.a has to be created at the root of your repository

Bonus Instrucctions

About

Recoded Printf function from Libc


Languages

Language:C 87.0%Language:Makefile 13.0%