Skip to content

LucasDatilioCarderelli/03-printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Printf

Project develop for 42Cursus

Linkedin GitHub code size in bytes Number of lines of code

Goal

This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.

Description

The versatility of the printf function in C represents a great exercise in programming for us. This project is of moderate difficulty. It will enable you to discover variadic functions in C. The key to a successful ft_printf is a well-structured and good extensible code.

Objectives:

  • Unix logic

Skills:

  • Rigor
  • Algorithms & AI

Brief

Write a library that contains ft_printf, a function that will mimic the real printf

Prototype

int ft_printf(const char *, ...);

External functs

read(2)
malloc(3)
free(1)
write(1)
STDARG(3)

A small description of the required conversion:

  • %c print a single character.
  • %s print a string of characters.
  • %p The void * pointer argument is printed in hexadecimal.
  • %d print a decimal (base 10) number.
  • %i print an integer in base 10.
  • %u print an unsigned decimal (base 10) number.
  • %x print a number in hexadecimal (base 16), with lowercase.
  • %X print a number in hexadecimal (base 16), with uppercase.
  • %% print a percent sign.