{"id":23307055,"url":"https://github.com/whoismtrx/42_ft_printf","last_synced_at":"2025-04-07T00:30:05.744Z","repository":{"id":228871698,"uuid":"441429998","full_name":"whoismtrx/42_ft_printf","owner":"whoismtrx","description":"ft_printf a project in 42 curriculum, we reimplement the printf function in C.","archived":false,"fork":false,"pushed_at":"2024-03-24T15:40:41.000Z","size":1623,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T06:17:09.498Z","etag":null,"topics":["1337","1337cursus","1337school","42","42born2code","42cursus","42projects","42school","c","clan","clanguage","ftprintf","ftprintf42","printf"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whoismtrx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-12-24T09:57:22.000Z","updated_at":"2024-03-20T20:48:55.000Z","dependencies_parsed_at":"2024-03-20T22:25:52.163Z","dependency_job_id":"6d7d40fe-d708-4c9a-8e7f-e8d66681b5f8","html_url":"https://github.com/whoismtrx/42_ft_printf","commit_stats":null,"previous_names":["whoismtrx/42_ft_printf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_ft_printf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_ft_printf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_ft_printf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whoismtrx%2F42_ft_printf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whoismtrx","download_url":"https://codeload.github.com/whoismtrx/42_ft_printf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574089,"owners_count":20960495,"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":["1337","1337cursus","1337school","42","42born2code","42cursus","42projects","42school","c","clan","clanguage","ftprintf","ftprintf42","printf"],"created_at":"2024-12-20T12:20:46.270Z","updated_at":"2025-04-07T00:30:05.709Z","avatar_url":"https://github.com/whoismtrx.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ft_printf\n\n![](https://github.com/whoismtrx/42_ft_printf/blob/main/ft_printf.gif)\n\n## Overview\n\nft_printf is a project at 42 that aims to mimic the behavior of the original printf function. The project is written in C and is a part of the curriculum at 42. it's a great project to learn about variadic functions and how to parse and format strings.\n\n## Key Features\n\nThe project contains 2 parts: `Mandatory` and `Bonus`. you need also create a `Makefile` to compile the project.\n- `Mandatory` part is about implementing wihtout buufering the basic functionality of the printf function like conversion specifiers: `cspdiuxX%` and return the number of printed characters.\n- `Bonus` part is about implementing the following conversion flags and manage with them all: `#0-+. ` yes the last character is a space.\n\n## Getting Started\n\nto compile the project you need to clone the repository first, to do that run the following command:\n```\ngit clone https://github.com/whoismtrx/42_ft_printf.git ft_printf\ncd ft_printf\nmake\n```\n\n## Usage\n\nto use the ft_printf function you need to include the header file in your project:\n```\n// example.c\n#include \"ft_printf.h\"\n```\n```\ncc example.c libftprintf.a -o example\n```\n\n## Implementation\n\nft_printf function supports the following conversion specifiers, width and flags:\n\n- `specifiers`:\n\t- `%` : print a `%` character.\n\t- `c` : print a character.\n\t- `s` : print a string.\n\t- `p` : print a pointer address.\n\t- `d` : print a decimal number.\n\t- `i` : print an integer.\n\t- `u` : print an unsigned integer.\n\t- `x` : print a hexadecimal number in lowercase.\n\t- `X` : print a hexadecimal number in uppercase.\n\n- `width`:\n\t- `number` : set the width to the number.\n\n- `flags`:\n\t- `#` : print the number in an alternative format.\n\t- `0` : print the number with leading zeros.\n\t- `-` : left-justify the number.\n\t- `+` : print the number with a sign.\n\t- `.` : print the number with a precision.\n\t- `space` : print the number with a space if no sign is printed.\n\n## Resources\n\nyou can find some resources about the project in the following links:\n- `variadic functions`: this is a great video about [variadic functions](https://www.youtube.com/watch?v=oDC208zvsdg\u0026t=5s\u0026ab_channel=CodeVault) and how to use them in C.\n- `printf`: this is a great article about [printf](https://docs.oracle.com/cd/E26502_01/html/E28556/gkxbc.html), also you can read this pdf [Secrets of printf](https://inst.eecs.berkeley.edu/~cs61c/fa19/hw/hw2/printf_colton.pdf) to understand how printf works.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhoismtrx%2F42_ft_printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhoismtrx%2F42_ft_printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhoismtrx%2F42_ft_printf/lists"}