"The goal of this project is pretty straightforward: code a clone of printf()."
Ft_printf is a project from the common core curriculum of 42 school. The goal of this project is to code a clone of the libc library printf(). The printf() function in C is a widely used function for formatted output. It stands for "print formatted" and is primarily used to display data on the screen or write it to a file. The function takes a format string as its first argument, which can contain placeholders called format specifiers. These placeholders are replaced by the values of additional arguments provided to the function.
- Returns the number of characters printed, excluding the null byte used to terminate output to strings.
The code was written according to the 42 norm guidelines(norminette).
- Clone the repository
git clone git@github.com:amauricoder/42_ft_printf.git
- Do make to compile the files
make
This will generate a libftprintf.a file in the root folder, this is the library containing the ft_printf().
- Go to your header file and include the library
# include "ft_printf.h"
- Syntax Example
ft_printf("This is a syntax usage example.\n Followed by a number %i.", nbr);
Those are the obligatory conversions requirements of the project - for more detail, check the subject:
- %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.
In this project, the Makefile offers the following essential rules:
- make: Compiles the project to libftprintf.a.
- make clean: Cleans the directory by removing
.o
files, preservinglibftprintf.a
. - make fclean: Completely cleans the directory by deleting both
.o
files andlibftprintf.a
. - make re: Refreshes
libftprintf.a
by recompiling everything.
Stop deceiving yourself. Mere ability to copy code doesn't enhance your skills. This is outside the scope of school purposes. Everyone can be a "copy paster," but not everyone can be a programmer. Good luck!