Skip to content

FlorentBelotti/42_cursus_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_cursus_printf

Recode the printf() function to learn about variadic functions and improve your C programming skills.

Table of Contents

Introduction

This project involves recreating the libc's printf() function. This will introduce you to variadic functions in C, a critical skill for handling functions that accept an indefinite number of arguments. Implementing this function will help you understand more about handling different data types and formatting output.

Common Instructions

  • The project must be coded in C and conform to the coding norm.
  • Handle memory properly - no leaks are tolerated.
  • Submit a Makefile that compiles your project with appropriate flags and does not relink.
  • Do not implement buffer management like the original printf().

Mandatory Part

Your implementation of ft_printf() must handle the following conversions: c, s, p, d, i, u, x, X, and %.

  • %c Prints a single character.
  • %s Prints a string.
  • %p Prints a void * pointer in hexadecimal format.
  • %d and %i Print a signed integer in base 10.
  • %u Prints an unsigned decimal (base 10) number.
  • %x Prints a number in hexadecimal (base 16) lowercase.
  • %X Prints a number in hexadecimal (base 16) uppercase.
  • %% Prints a percent sign.

Bonus Part

For those who complete the mandatory part perfectly, the bonus part includes handling flags and minimum field widths under all conversions.

  • Flags: '-', '0', '.', '#', '+', and ' '(space).

Compilation

Compile the library using the Makefile provided, ensuring all rules like all, clean, fclean, and re are present to manage the library properly.

About

Recode printf().

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published