{"id":26202452,"url":"https://github.com/f-corvaro/ft_printf","last_synced_at":"2025-03-12T03:37:15.255Z","repository":{"id":221991882,"uuid":"755976188","full_name":"f-corvaro/FT_PRINTF","owner":"f-corvaro","description":"\"Custom printf implementation\"","archived":false,"fork":false,"pushed_at":"2024-07-27T17:22:01.000Z","size":2360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-27T18:47:00.202Z","etag":null,"topics":["42","42project","42roma","42romaluiss","42school","bonus","c","cross-platform","education","ftprintf","ftprintf-42","ftprintf42","guide","linux","macos","mandatory","static-library","variadic-function"],"latest_commit_sha":null,"homepage":"https://github.com/f-corvaro","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f-corvaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"f-corvaro","ko_fi":"fcorvaro"}},"created_at":"2024-02-11T16:27:06.000Z","updated_at":"2024-07-27T17:22:04.000Z","dependencies_parsed_at":"2024-02-11T17:20:10.278Z","dependency_job_id":"a9eedc2d-de5e-46e7-9fee-abdec666dd26","html_url":"https://github.com/f-corvaro/FT_PRINTF","commit_stats":null,"previous_names":["f-corvaro/ft_printf"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-corvaro%2FFT_PRINTF","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-corvaro%2FFT_PRINTF/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-corvaro%2FFT_PRINTF/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-corvaro%2FFT_PRINTF/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f-corvaro","download_url":"https://codeload.github.com/f-corvaro/FT_PRINTF/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243152861,"owners_count":20244656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42project","42roma","42romaluiss","42school","bonus","c","cross-platform","education","ftprintf","ftprintf-42","ftprintf42","guide","linux","macos","mandatory","static-library","variadic-function"],"created_at":"2025-03-12T03:37:14.589Z","updated_at":"2025-03-12T03:37:15.245Z","avatar_url":"https://github.com/f-corvaro.png","language":"C","readme":"\u003ch1 align=\"center\"\u003e\u003ca href=\"https://github.com/f-corvaro/FT_PRINTF\"\u003e\u003cimg src=\"https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/ft_printf.png\"\u003e\u003c/a\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003e\u003ci\u003e\"Custom printf implementation\"\u003c/i\u003e\u003c/b\u003e\u003cbr\u003e\n\u003c/p\u003e\n\u003cp align=\"center\" style=\"text-decoration: none;\"\u003e\n    \u003ca href=\"https://github.com/f-corvaro/FT_PRINTF\"\u003e\u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/f-corvaro/FT_PRINTF?color=blueviolet\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/f-corvaro/FT_PRINTF\"\u003e\u003cimg alt=\"Code language count\" src=\"https://img.shields.io/github/languages/count/f-corvaro/FT_PRINTF?color=yellow\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/f-corvaro/FT_PRINTF\"\u003e\u003cimg alt=\"GitHub top language\" src=\"https://img.shields.io/github/languages/top/f-corvaro/FT_PRINTF?color=blueviolet\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/f-corvaro/FT_PRINTF\"\u003e\u003cimg alt=\"GitHub last commit\" src=\"https://img.shields.io/github/last-commit/f-corvaro/FT_PRINTF?color=yellow\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\nv9 | v10\n:-------------------------:|:-------------------------:\n[![subject-old](https://img.shields.io/badge/subject-ft_printf_v09-blueviolet)](https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/en.subject.pdf) | [![subject-new](https://img.shields.io/badge/subject-ft_printf_v10-blueviolet)](https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/en.subject(new).pdf)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\u003ctr\u003e\u003ctd\u003eThis guide is for subject v10. There are no differences between the two subjects.\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n\n**WARNING:** *Before pushing, ensure you know where the moulinette will be executed. The length and information printed by `printf` can differ between macOS and Ubuntu systems. If you choose `ft_printf_100`, verify where the moulinette runs. For `ft_printf_125`, there are two macro conditions that will validate your project on both systems.*\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n\u003ch3 align=\"center\"\u003eIndex\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#folder-structure\"\u003eFolder Structure\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#project-requirements---mandatory-part\"\u003eProject Requirements - Mandatory Part\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#important-guidelines\"\u003eImportant Guidelines\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#project-requirements\"\u003eProject Requirements\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#library-name\"\u003eLibrary Name\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#submission-files\"\u003eSubmission Files\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#required-makefile-rules\"\u003eRequired Makefile Rules\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#allowed-external-functions\"\u003eAllowed External Functions\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#ft_printf-prototype\"\u003e`ft_printf()` Prototype\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#project-requirements---bonus-part\"\u003eProject Requirements - Bonus Part\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#bonus-list\"\u003eBonus List\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#theoretical-background\"\u003eTheoretical Background\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#understanding-printf-in-c\"\u003eUnderstanding `printf` in C\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#return-value\"\u003eReturn Value\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#flags-and-witdth-modifiers\"\u003eFlags and Width Modifiers\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#variadic-functions\"\u003eVariadic Functions\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#static-libraries\"\u003eStatic Libraries\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#makefile-cross-platform-compatibility-integration-with-other-projects\"\u003eMakefile: Cross-Platform Compatibility, Integration with Other Projects\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#executing-tests\"\u003eExecuting Tests\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#testing-the-mandatory-part\"\u003eTesting the Mandatory Part\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#tester\"\u003eTester\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#memory-leak-detection-with-valgrind\"\u003eMemory Leak Detection with Valgrind\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#evaluation-process\"\u003eEvaluation Process\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#correction-sheet\"\u003eCorrection Sheet\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#moulinette-feedback\"\u003eMoulinette Feedback\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#developed-skills\"\u003eDeveloped Skills\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#references\"\u003eReferences\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#support-and-contributions\"\u003eSupport and Contributions\u003c/a\u003e\u003cbr\u003e\n \u003ca href=\"#author\"\u003eAuthor\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Introduction\n\n\u003cp align=\"justify\"\u003e\n\nThe ft_printf project is a part of the curriculum at 42 school, aimed at teaching students the intricacies of implementing their own version of the printf function. The project involves creating a library, that includes libft, which mimics the functionality of the original printf function from the C standard library.  \n\n\u003c/p\u003e\n\n### Overview\n\n\u003cp align=\"justify\"\u003e\n\nStudents are required to handle various format specifiers, such as %c, %s, %d, %i, %u, %x, %X, and %%, as well as manage flags and field width options. The project also introduces students to the concept of variadic functions and the use of the va_start, va_arg, va_copy, and va_end macros. \n\nBy completing this project, students gain a deeper understanding of string formatting and the inner workings of printf-like functions.\n\n\u003c/p\u003e\n\u003c/br\u003e\n\n## Folder Structure\n\n```\n.\n├── 01-ft_printf\n│   ├── ft_printf\n│   │   ├── ft_printf_100\n│   │   │   ├── ft_printf_macOS\n│   │   │   │   ├── ft_printf\n│   │   │   │   │   ├── ft_hexadecimal.c\n│   │   │   │   │   ├── ft_pointer.c\n│   │   │   │   │   ├── ft_printf.c\n│   │   │   │   │   ├── ft_printf.h\n│   │   │   │   │   ├── ft_unsigned.c\n│   │   │   │   │   └── ft_utils.c\n│   │   │   │   ├── libft\n│   │   │   └── ft_printf_ubuntu\n│   │   │       ├── ft_printf\n│   │   │       │   ├── ft_hexadecimal.c\n│   │   │       │   ├── ft_pointer.c\n│   │   │       │   ├── ft_printf.c\n│   │   │       │   ├── ft_printf.h\n│   │   │       │   ├── ft_unsigned.c\n│   │   │       │   └── ft_utils.c\n│   │   │       ├── libft\n│   │   │       └── Makefile\n│   │   └── ft_printf_125\n│   │       ├── include\n│   │       │   └── ft_printf.h\n│   │       ├── libft\n│   │       │   ├── include\n│   │       │   ├── srcs\n│   │       │   └── Makefile\n│   │       ├── srcs\n│   │       │   ├── ft_format.c\n│   │       │   ├── ft_parse_and_handle_funcs.c\n│   │       │   ├── ft_printf_funcs.c\n│   │       │   ├── ft_printf.c\n│   │       │   ├── ft_ptr.c\n│   │       │   └── ft_utility_funcs.c\n│   │       └── Makefile\n│   ├── main.c\n│   └── README.md\n```\n\n\u003c/br\u003e\n\n## Project Requirements - Mandatory Part\n\n### Important Guidelines:\n\n\u003cp align=\"justify\"\u003e\n\n- This project must be written in C.\n- Must adhere to the Norm.\n- The function should not quit unexpectedly (segmentation fault, bus error, double free, etc.) except for undefined behaviors.\n- All heap-allocated memory must be properly freed when necessary. No memory leaks allowed.\n- The Makefile to submit must compile the source files with the flags `-Wall -Werror -Wextra` using the `cc` compiler. The Makefile must not relink.\n- The `libft` is allowed in this project. You must copy its sources and its associated Makefile into a `libft` folder.\n\n\u003cp\u003e\n\u003cbr\u003e\n\n### Project Requirements: \n\n\u003cp align=\"justify\"\u003e\n\n- Do not implement the buffer management of the original `printf()`.\n- Your function must handle the following conversions: `cspdiuxX%`.\n- Your function will be compared against the original `printf()`.\n- You must use the `ar` command to create your library. Using the `libtool` command is forbidden.\n- Your `libftprintf.a` must be created at the root of your repository.\n\nYou have to implement the following conversions:\n\n| Format specifier | Data type |\n| ---------------- | --------- |\n| `%c` | single character |\n| `%s` | string |\n| `%p` | The `void *` pointer argument must be printed in hexadecimal format |\n| `%d` | decimal (base 10) number |\n| `%i` | integer in base 10 |\n| `%u` | unsigned decimal (base 10) number |\n| `%x` | number in hexadecimal (base 16) lowercase format |\n| `%X` | number in hexadecimal (base 16) uppercase format |\n| `%%` | Percent sign |\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n### Library Name: \n\n`libftprintf.a`\n\n### Submission Files:\n\n`Makefile, *.h, */*.h, *.c, */*.c`\n\n \u003cp align=\"justify\"\u003e\n\n You can create your own directory with any name you prefer. The same applies to the `.h` and `.c` files, which can be stored in any directory.\n\n \u003c/p\u003e\n\n### Required Makefile Rules:\n\n`NAME, all, clean, fclean, re`\n\n\u003c/p\u003e\n\n### Allowed External Functions: \n\n`malloc, free, write, va_start, va_arg, va_copy, va_end`\n\n\u003c/p\u003e\n\n### `ft_printf()` Prototype: \n\n`int\tft_printf(const char *, ...);`\n\n\u003cp align=\"justify\"\u003e\n\nBasically, how does it work? `ft_printf()` takes two arguments: The first is a string that specifies how the output should be formatted. The second is a variable number of arguments, which are the values that will be formatted and printed (similar to how the real `printf()` function works).\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Project Requirements - Bonus Part\n\n\u003cp align=\"justify\"\u003e\n\nYou don't have to complete all the bonuses. You can choose from the following options:\n\n### Bonus List:\n\n\u003cp align=\"justify\"\u003e\n\n- Handle any combination of the following flags: `-0.` and the field minimum width for all conversions.\n  \n | Flag | Description |\n | ---- | ----------- |\n | `%0` | When the 'width' option is specified, prepends zeros for numeric types (default prepends spaces). For example, `printf(\"%4X\", 3)` produces `   3`, while `printf(\"%04X\", 3)` produces `0003`. |\n | `%-` | Left-aligns the output of this placeholder (default is right-aligned). |\n | `%.` | Specifies precision for numeric types. |\n\n- Handle all the following flags: `# +` (Note: one of them is a space).\n\n | Flag | Description |\n | ---- | ----------- |\n | `% (space)` | Prepends a space for positive signed-numeric types. Positive = ` `, Negative = `-`. Ignored if the `+` flag is present (default doesn't prepend anything for positive numbers). |\n | `%#` | For `g` and `G` types, trailing zeros are not removed. For `f`, `F`, `e`, `E`, `g`, `G` types, the output always contains a decimal point. For `o`, `x`, `X` types, `0`, `0x`, `0X` respectively are prepended to non-zero numbers. |\n | `%+` | Always shows the sign of the number (default hides the sign for positive numbers). |\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Theoretical Background\n\n### Understanding `printf` in C\n\n\u003cp align=\"justify\"\u003e\n\nThe `printf()` function in C is a widely used function for displaying formatted output on the console. It provides developers with a flexible and convenient way to print various types of data. By using format specifiers such as `%c`, `%s`, `%p`, `%d`, `%i`, `%u`, `%x`, `%X`, and `%%`, programmers can control the formatting of the output and make it more readable. With the `printf()` function, developers can create well-formatted and visually appealing console displays.\n\n\u003c/p\u003e\n\n#### Return Value\n\n\u003cp align=\"justify\"\u003e\n\n`printf` returns an integer value that represents the total number of characters successfully printed to the standard output. If there is an error during the printing process, a negative value is returned. You can test it with the following example:\n\n```c\nint\tmain(void)\n{\n\t#include \u003cstdio.h\u003e\n\n\tint\ti;\n\n\ti = 0;\n\ti = printf(\"%s\\n\", \"try\");\n\tprintf (\"%d\\n\", i);\n\n\n\treturn(0);\n}\n```\n\n#### Flags and Witdth Modifiers\n\n**Syntax:**\n\n ```%[flags][width][.precision][length]specifier```\n\n1. **%**: Used before the specifier.\n2. **Specifier**: Character that denotes the type of data.\n3. **Width**: Minimum number of characters to be printed. If the number of characters is less than the specified width, white space will fill the remaining places. If the number of characters exceeds the specified width, all characters will be printed without truncation.\n4. **Precision**: Varies by format specifier. For integral data (`d`, `i`, `u`, `o`, `x`, `X`), it specifies the minimum number of digits, adding leading zeroes if necessary. For floating-point data (`f`, `e`, `a`, `A`), it specifies the number of digits after the decimal point. For strings (`s`), it specifies the maximum length of the string to be printed.\n5. **Length**: Specifies the length of the data type in memory, used with data type modifiers.\n\nLength sub-specifiers:\n- **h**: Short int and unsigned short int\n- **l**: Long int and unsigned long int\n- **L**: Long double\n\nFlags and width modifiers are essential features of the `printf()` function in C, allowing developers to control output formatting. Flags modify the behavior of the conversion specifier, while width modifiers specify the minimum field width for the output.\n\nCommon flags include:\n- **`-`**: Left-aligns the output.\n- **`0`**: Pads the output with zeros instead of spaces.\n- **`#`**: Adds special formatting to certain specifiers.\n\nWidth modifiers set the minimum field width. For example, if the width is 5 and the output is 3 characters long, it will be padded with spaces or zeros to meet the width requirement.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n### Variadic Functions\n\n\u003cp align=\"justify\"\u003e\n\nVariadic functions are functions in C that can accept a variable number of arguments. They are useful when the number of arguments or their types are not known in advance. In the context of the ft_printf project for the 42 curriculum, variadic functions are used to handle the variable arguments passed to the ft_printf function. The key functions used to work with variadic arguments are va_start, va_arg, va_copy, and va_end. \n\n- `va_start` is used to initialize the argument list. It takes two arguments: the first is the va_list object that will hold the variable arguments, and the second is the last named parameter before the variable arguments.\n\n- `va_arg` is used to retrieve the next argument from the va_list. It takes two arguments: the first is the va_list object, and the second is the type of the argument to retrieve.\n\n- `va_copy` is used to make a copy of the va_list object. It takes two arguments: the first is the destination va_list object, and the second is the source va_list object.\n\n- `va_end` is used to clean up the va_list object. It takes one argument: the va_list object to be cleaned up.\n\nBy using these variadic functions, the ft_printf function can handle different format specifiers and their corresponding arguments, allowing for flexible and dynamic formatting of the output. Variadic functions are a powerful tool in C programming, enabling the implementation of functions that can adapt to different input requirements.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n### Static Libraries\n\n\u003cp align=\"justify\"\u003e\n\nStatic libraries play a crucial role in organizing and managing the codebase. A static library, denoted by the `.a` extension, is a collection of precompiled object files that can be linked with other programs at compile time. By creating a static library for ft_printf, we can encapsulate the implementation details of the printf function and provide a clean and modular interface for other programs to use. This allows for code reuse and simplifies the process of incorporating ft_printf into different projects. Additionally, static libraries offer the advantage of faster compilation times, as the library code is already compiled and can be linked directly into the final executable. Overall, static libraries are an essential tool in the development of ft_printf, enabling code organization, reusability, and improved compilation efficiency.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n### Makefile: Cross-Platform Compatibility, Integration with Other Projects\n\n\u003cp align=\"justify\"\u003e\n\nThe Makefile is an essential component in the ft_printf project. It serves as a build automation tool, providing instructions on how to compile and link the source code into the final executable or library. By correctly utilizing the Makefile, developers can easily manage dependencies, compile only the necessary files, and ensure consistent and efficient builds. In the context of ft_printf, the Makefile can be integrated with the existing libft library, allowing for seamless usage of its functions. Additionally, the Makefile ensures cross-platform compatibility, enabling the project to be built and executed on different operating systems. The .PHONY rule in the Makefile is used to define false targets, which represent groups of commands or actions that are not associated with actual files. This allows developers to execute specific tasks without worrying about conflicting file names or dependencies. Overall, the Makefile plays a crucial role in the successful development and deployment of the projects.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Executing Tests\n\n### Testing the Mandatory Part\n\n\u003cp align=\"justify\"\u003e\n\nTo test this project, you need to create a `main.c` file. You can find an example [here](https://github.com/f-corvaro/FT_PRINTF/blob/main/main.c). The example focuses on a specific specifier due to encountered issues, but you can implement additional tests as needed. After creating `main.c`, run `make all`, and then compile the code:\n\n- **macOS:** Use `gcc main.c libftprintf.a` to compile. Then, execute the `a.out` file. The expected output is:\n\n```shell\ne4r4p2% ./a.out\n 0x0 0x0 real: 9\n 0x0 0x0 fake: 9\n```\n\n- **Ubuntu:** First, compile with gcc -c main.c, then link with gcc main.o libftprintf.a. The expected output is:\n\n```bash\ne4r4p2% ./a.out\n(nil) (nil) real: 13\n(nil) (nil) fake: 13\n```\n\n\u003c/p\u003e\n\n### Tester\n\n\u003cp align=\"justify\"\u003e\n\nI have used the [printfTester](https://github.com/Tripouille/printfTester) by [Tripouille](https://github.com/Tripouille). It is crucial to test the project on both Ubuntu and macOS, as the tester may yield different results on each platform.\n\n\u003c/p\u003e\n\n### Memory Leak Detection with Valgrind\n\nTo find memory leaks and errors, I used `Valgrind`. Below are the steps for installation and usage:\n\n#### Installation\n\nDepending on your Linux distribution, use one of the following commands to install Valgrind:\n\n```shell\nsudo apt install valgrind  # Ubuntu, Debian, etc.\nsudo yum install valgrind  # RHEL, CentOS, Fedora, etc.\nsudo pacman -Syu valgrind  # Arch, Manjaro, Garuda, etc.\nsudo pkg ins valgrind      # FreeBSD\n```\n\n#### Usage\n\nTo check for memory leaks and errors, use the following Valgrind command:\n\n```shell\nvalgrind --leak-check=full --show-leak-kinds=all --track-origins=yes -s ./a.out\n```\n\n- `--leak-check=full`: Perform a detailed memory leak check.\n- `--show-leak-kinds=all`: Show all kinds of leaks, including definitely lost, indirectly lost, possibly lost, and still reachable.\n- `--track-origins=yes`: Track the origins of uninitialized values.\n- `-s`: Provide a summary of the leak check.\n- ADDITIONAL `--log-file`: Directs Valgrind's output to a specified file. This is useful for preserving extensive output that exceeds terminal capacity, allowing for easier review and analysis.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Evaluation Process\n\n### Correction Sheet\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/f-corvaro/FT_PRINTF/tree/main\"\u003e\u003cimg width=\"650\" src=\"https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/eval_10-2023.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/f-corvaro/FT_PRINTF/tree/main\"\u003e\u003cimg width=\"650\" src=\"https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/eval_10-2023(2).png\"\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n### Moulinette Feedback\n\n\u003cp align=\"justify\"\u003e\n\nI completed this project three times. The first time, I failed because I only did the mandatory part and worked on an Ubuntu system, which caused an issue with the void pointer condition. The second time, I fixed the problem and received a score of 100.\n\n\u003ca href=\"https://projects.intra.42.fr/projects/42cursus-ft_printf/projects_users/3069521\"\u003e\u003cimg align=\"center\" src=\"https://github.com/f-corvaro/FT_PRINTF/blob/main/.extra/moulinette.png\"\u003e\n\nThe third time, I completed the bonus part and achieved a score of 125.\n\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Developed Skills\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://skillicons.dev\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=git,c,vim,vscode\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\u003cbr\u003e\n\n## References\n\n- [IBM Documentation on Variadic Functions](https://www.ibm.com/docs/en/i/7.3?topic=lf-va-arg-va-copy-va-end-va-start-handle-variable-argument-list) - Comprehensive guide on handling variable argument lists in C.\n- [GeeksforGeeks: Variadic Functions](https://www.geeksforgeeks.org/variadic-functions-in-c/) - Tutorial on variadic functions with examples.\n- [Medium: Variadic Functions Explained](https://onepunchcoder.medium.com/variadic-functions-explained-fd3b4ab6fd84) - In-depth explanation of variadic functions.\n- [GNU Make Manual](https://www.gnu.org/software/make/manual/make.html#Rule-Introduction) - Official documentation for writing Makefiles.\n- [Wikipedia: printf](https://en.wikipedia.org/wiki/Printf) - Overview and history of the `printf` function.\n- [GeeksforGeeks: printf in C](https://www.geeksforgeeks.org/printf-in-c/) - Detailed guide on using `printf` in C.\n- [Dev.to: Static Libraries in C](https://dev.to/iamkhalil42/all-you-need-to-know-about-c-static-libraries-1o0b) - All you need to know about creating and using static libraries in C.\n  \n\u003cbr\u003e\n\n## Support and Contributions\n\n\u003cp align=\"center\"\u003e\nIf you find this repository helpful, please consider starring it to show your support. Your support is greatly appreciated!\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://ko-fi.com/fcorvaro\"\u003e\u003cimg width=\"180\" img align=\"center\" src=\"https://github.com/f-corvaro/42.common_core/blob/main/.extra/support-me-ko-fi.svg\"\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sponsors/f-corvaro\"\u003e\u003cimg width=\"180\" img align=\"center\" src=\"https://github.com/f-corvaro/42.common_core/blob/main/.extra/support-me-github.svg\"\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\n\u003cbr\u003e\n\n## Author\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://profile.intra.42.fr/users/fcorvaro\"\u003e\u003cimg style=\"height:auto;\" src=\"https://avatars.githubusercontent.com/u/102758065?v=4\" width=\"100\" height=\"100\"alt=\"\"\u003e\u003c/a\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"mailto:fcorvaro@student.42roma.it\"\u003e\u003ckbd\u003eEmail\u003c/kbd\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/f-corvaro\"\u003e\u003ckbd\u003eGithub\u003c/kbd\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.linkedin.com/in/f-corvaro/\"\u003e\u003ckbd\u003eLinkedin\u003c/kbd\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\u003ca href=\"https://42born2code.slack.com/team/U050L8XAFLK\"\u003e\u003ckbd\u003eSlack\u003c/kbd\u003e\u003calt=\"\"\u003e\u003c/a\u003e\n\n\u003chr/\u003e\n","funding_links":["https://github.com/sponsors/f-corvaro","https://ko-fi.com/fcorvaro"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-corvaro%2Fft_printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff-corvaro%2Fft_printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-corvaro%2Fft_printf/lists"}