Skip to content

Reprodução da super útil função printf! Terceiro projeto da 42👩🏼‍💻

Notifications You must be signed in to change notification settings

rach-noronha/Printf_42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Printf_42 🚀

Variadic arguments are usefull!

💡About

Summary: The goal of this project is pretty straightforward. Recode printf(). You will mainly learn about using a variable number of arguments. How cool is that?? It is actually pretty cool :)

Mandatory

  • format specifiers - cspdiuxX%

Functions in ft_printf.c

  • ft_printf (and auxiliary static functions) - Initialization function: start/end variadic arguments functions <stdarg.h>; in between that, goes through the input string printing plain characters or collecting + treating format specifiers to the print_specified function, thus printing each occurrance with the corresponding function.

  • print_specified - Verifies each format specifier and calls functions in accordance with the collected format specifiers.

The following functions output the input variable (collected by va_arg function) as a pointer to a string to be printed by the print_specified function.

Functions in print_alpha.c

  • ft_putchar - character (%c) type input variable;
  • ft_putstr - string (%s) type input variable;

Functions in print_numeric.c

  • ft_putnbr - int (%i and %d) type input variables;
  • ft_puthexa - lower (%x) and upper hexadecimal (%X) type input variables;
  • ft_putunbr - unsigned int (%u) type input variables;
  • ft_putptr - pointer (%p) type input variable.

About

Reprodução da super útil função printf! Terceiro projeto da 42👩🏼‍💻

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published