{"id":20383587,"url":"https://github.com/ygor-sena/42cursus-ft-printf","last_synced_at":"2026-06-01T04:31:55.110Z","repository":{"id":44521170,"uuid":"512799281","full_name":"ygor-sena/42cursus-ft-printf","owner":"ygor-sena","description":"The third project of 42 curriculum asks students to reproduce some features of the famous printf() function.","archived":false,"fork":false,"pushed_at":"2024-04-04T16:41:55.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-18T22:32:49.482Z","etag":null,"topics":["42","42-ft-printf","42cursus","42saopaulo","42school","42sp","ansi-c","c","ecole42"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ygor-sena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-07-11T14:53:48.000Z","updated_at":"2023-01-18T23:45:57.000Z","dependencies_parsed_at":"2024-11-15T02:34:33.572Z","dependency_job_id":null,"html_url":"https://github.com/ygor-sena/42cursus-ft-printf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ygor-sena/42cursus-ft-printf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygor-sena%2F42cursus-ft-printf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygor-sena%2F42cursus-ft-printf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygor-sena%2F42cursus-ft-printf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygor-sena%2F42cursus-ft-printf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ygor-sena","download_url":"https://codeload.github.com/ygor-sena/42cursus-ft-printf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygor-sena%2F42cursus-ft-printf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33760645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","42-ft-printf","42cursus","42saopaulo","42school","42sp","ansi-c","c","ecole42"],"created_at":"2024-11-15T02:23:27.914Z","updated_at":"2026-06-01T04:31:55.095Z","avatar_url":"https://github.com/ygor-sena.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/102881479/215298013-ff93daf3-6f0c-4226-9474-65b280e579fe.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/OS-Linux-blue\" alt=\"OS\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Language-C%20%7C%20C%2B%2B-blue.svg\" alt=\"Language\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Grade-110%2F100-brightgreen.svg\" alt=\"Grade\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Status-Completed-brightgreen.svg\" alt=\"Status\"\u003e\n\u003c/p\u003e\n\n\n## 📣 Introduction\n\nThis project is pretty straightforward. It asks students to recode `printf()` in order to make them learn about how a **variadic function** works. It also aims to make students think about how they are going to implement the project. After all, the key to a successful `ft_printf` is a well-structured and extensible code.\n\nInside the folder [`ft-printf-studies`](https://github.com/ygor-sena/42cursus-ft-printf/blob/main/ft-printf-studies/ft_printf_studies.c) there is a file that test all the possible combinations of `printf` flags.\n\n## ✨ Implemented features\n\n#### Mandatory\n\n- ✅ The function has to implement the following conversions: `cspdiuxX%`\n\n| Conversion | Description |\n|:----|:-----|\n| `c`  | Prints a single character. |\n| `s`  | Prints a string (as defined by the common C convention). |\n| `p`  | The `void *` pointer argument has to be printed in hexadecimal format. |\n| `d`  | Prints a decimal (base 10) number. |\n| `i`  | Prints an integer in base 10. |\n| `u`  | Prints an unsigned decimal (base 10) number. |\n| `x`  | Prints a number in hexadecimal (base 16) lowercase format. |\n| `X`  | Prints a number in hexadecimal (base 16) uppercase format. |\n| `%`  | Prints a percent sign. |\n\n#### Bonus 1\n\n- ❌ Manage any combination of the following flags: `-0.` and the field minimum width under all conversions.\n\n| Flag | Description |\n|:----|:-----|\n| `-`  | Left aligns the argument passed. |\n| `0`  | Add '0' as a padding character in numeric conversions (single space is default). |\n| `.`  | Precision definition, followed by a number. |\n\n#### Bonus 2\n\n- ✅ Manage all the following flags: `# +` (Yes, one of them is a space).\n\n| Flag | Description |\n|:----|:-----|\n| `' '`  | Adds a single space (`' '`) in the front of positive numeric conversions. |\n| `#`  | Adds the corresponding prefix in front of `x` and `X` conversions. |\n| `+`  | Adds a plus sign (`+`) in the front of positive numeric conversions. |\n\n\n## ⚒️ How to use the project\n\nRun `make` or `make bonus` if you want to compile the mandatory project or the bonus project respectively.\n\nAfter that, to use the `ft_printf()` in your project it's necessary to include the library `libftprintf.a` and the header as follows:\n\n```c\n#include \"ft_printf.h\" \n```\n\nIf you want to include the bonus version, use:\n\n```c\n#include \"ft_printf_bonus.h\" \n```\n\nDon't forget to add the following flags when compiling your project:\n\n```bash\ngcc ... -lftprintf -L path/to/libftprintf.a -I path/to/libftprintf.h\n```\n\n## 📖 References\n\n- [Criando Funções Com Número Variável De Argumentos Em C](https://daemoniolabs.wordpress.com/tag/como-utilizar-va_start-va_arg-va_end-e-va_list/) by [Daemonio Labs](https://daemoniolabs.wordpress.com/).\n\n- [Formatted output](https://www.gnu.org/software/libc/manual/html_node/Formatted-Output.html) in _12. Input/Output on Streams_ by [The GNU C Library Reference Manual](https://www.gnu.org/software/libc/manual/2.36/html_mono/libc.html).\n- COLTON, Don. [Secrets of “printf”](https://www.studocu.com/en-us/document/florida-institute-of-technology/ae-comp-techniques/secrets-of-printf/3918181). Brigham Young University Hawaii, 2014.\n- [C++ Documentation of printf()](https://cplusplus.com/reference/cstdio/printf/) by [cplusplus.com](https://cplusplus.com/reference/).\n- To test the project features, I used the [ft_printf_tester](https://github.com/paulo-santana/ft_printf_tester.git) made by [Paulo Santana](https://github.com/paulo-santana).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fygor-sena%2F42cursus-ft-printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fygor-sena%2F42cursus-ft-printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fygor-sena%2F42cursus-ft-printf/lists"}