Skip to content

Second project of 42 Cursus which consists in replicating the "printf" function of the libc

Notifications You must be signed in to change notification settings

antoniolopez7217/42Cursus_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 

Repository files navigation

42Cursus_printf

Second project of 42 Cursus which consists in replicating the printf() function of the libc.

The prototype of ft_printf() will be:

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

The following conversions will be implemented:

Conversion Description
%c Prints a single character
%s Prints a string (as defined by default in C)
%p The void pointer * given as argument is printed in hexadecimal format
%d Prints a decimal number (base 10)
%i Prints an integer in base 10
%u Prints an unsigned decimal number (base 10)
%x Prints a hexadecimal number (base 16) in lowercase
%X Prints a hexadecimal number (base 16) in uppercase
%% Prints the percent symbol

🛠️ How to use it?

1. Compiling the function

To compile the function, you need to enter in the repository where printf is and run:

make

2. Cleaning the files

You can remove the .o files with:

make clean

To remove all the files generated by make:

make fclean

3. Using the function in your code

In case that you want to use the printf function in your code, you need to include the header in your .c files:

#include "ft_printf.h"

Then you need to compile your main.c file with the libftprintf.a file generated after compiling it with make.

cc -Wall -Wextra -Werror main.c libftprintf.a

💡 Useful links

Linkedin Badge

About

Second project of 42 Cursus which consists in replicating the "printf" function of the libc

Topics

Resources

Stars

Watchers

Forks