{"id":25764454,"url":"https://github.com/mewmewdevart/ft_printf","last_synced_at":"2025-02-26T21:18:06.556Z","repository":{"id":63149870,"uuid":"558900280","full_name":"mewmewdevart/ft_printf","owner":"mewmewdevart","description":"[42 Cursus]  Because ft_putnbr() and ft_putstr() aren’t enough","archived":false,"fork":false,"pushed_at":"2022-11-21T18:23:18.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-10T13:06:29.536Z","etag":null,"topics":["42born2code","c","library","makefile","printf","programming","variadic-arguments"],"latest_commit_sha":null,"homepage":"","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/mewmewdevart.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}},"created_at":"2022-10-28T14:51:01.000Z","updated_at":"2022-11-18T10:13:19.000Z","dependencies_parsed_at":"2023-01-22T13:00:13.995Z","dependency_job_id":null,"html_url":"https://github.com/mewmewdevart/ft_printf","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mewmewdevart%2Fft_printf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mewmewdevart%2Fft_printf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mewmewdevart%2Fft_printf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mewmewdevart%2Fft_printf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mewmewdevart","download_url":"https://codeload.github.com/mewmewdevart/ft_printf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240934405,"owners_count":19880992,"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":["42born2code","c","library","makefile","printf","programming","variadic-arguments"],"created_at":"2025-02-26T21:18:06.048Z","updated_at":"2025-02-26T21:18:06.544Z","avatar_url":"https://github.com/mewmewdevart.png","language":"C","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/50052600/202604870-5f64e421-2529-4e21-b94a-25a945b2af3b.png\" /\u003e\n\u003c/p\u003e\n\n\n\u003ch1 align=\"center\"\u003e\n ft_printf\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cb\u003e\u003ci\u003eWrite a library that contains ft_printf(), a function that will mimic the original printf()\u003c/i\u003e\u003c/b\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/mewmewdevart/ft_printf?color=6272a4\" /\u003e\n\t\u003cimg alt=\"Main language\" src=\"https://img.shields.io/github/languages/top/mewmewdevart/ft_printf?color=6272a4\"/\u003e\n\t\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/mewmewdevart/ft_printf?color=6272a4\"/\u003e\n\u003c/p\u003e\n\n## 💡 About the project\n\n\u003e _For the ft_printf() project of the 42 school cursus, we must recreate the famous C library printf() function. This project teaches us about variadic arguments. The printf() function sends a formatted string to the standard output (the display). \u003cbr\u003e My ft_printf has to handle the following conversions: ↓ \n\u003e - %c Prints a single character.\n\u003e - %s Prints a string (as defined by the common C convention).\n\u003e - %p The void * pointer argument has to be printed in hexadecimal format.\n\u003e - %d Prints a decimal (base 10) number.\n\u003e - %i Prints an integer in base 10.\n\u003e - %u Prints an unsigned decimal (base 10) number.\n\u003e - %x Prints a number in hexadecimal (base 16) lowercase format.\n\u003e - %X Prints a number in hexadecimal (base 16) uppercase format.\n\u003e - %% Prints a percent sign.\n\n## 📁 Files/\n* [`libraries/`](libraries) \n\tCalling for my libraries \u003cbr\u003e\n\t- ```libft/``` my custom-made library ( [see the project here](https://github.com/mewmewdevart/libft) )\n\t- ```ft_printf.h``` my ft_printf header to connect the functions created for this project\n* [`sources/`](sources)[`ft_printf.c`](sources/ft_printf.c)  My main function implementation\n\t- ```ft_printf``` the \"controller\" \n\t- ```ft_translate``` translate what happens after the % symbol\n\t\t- ```ft_putchar``` write a character, of unsigned char type, to stdout (libft) \u003cbr\u003e\n\t\t- ```ft_putnbr``` function to diplay number (converted) with \"ft_putchar\" function  (libft)\n\t\t- ```ft_putnbr_unsigned``` function to diplay number (unsigned int) with \"ft_putchar\" function  (libft)\n\t\t- ```ft_putptr``` function  print the address of pointer with \"ft_puthexa\" function(libft)\n\t\t- ```ft_puthex``` function to printf in hexadecimal format (libft)\n* [`Makefile`](Makefile) My build automation between libft and ft_printf libraries\n\n## 🛠️ Usage\n\n### Requirements\n\nThis project requires [GNU Compiler Collection](https://gcc.gnu.org/) and [GNU Make](https://www.gnu.org/software/make/) compiler. \u003cbr\u003e\n❗️| Make sure you have all the required tools installed on your local machine then continue with these steps.\n\n### Instructions\n\n**0. Download the archives**\n\nDownload the archives and go to the library directory:\n\n```bash\n# Clone the repository\n$ git clone https://github.com/mewmewdevart/ft_printf\n\n# Enter into the directory\n$ cd ft_printf/\n```\n\n**1. Compiling the library**\n\nRun the command in your terminal :\n\n```shell\n$ make\n```\n\n**2. Using it in your code**\n\nTo use the ft_printf actions in your code, simply include its header:\n\n```c\n#include \"libraries/ft_printf.h\"\n```\nAnd create a main with some inserts/conversions \u003cbr\u003e\nExample ``main.c``:\n```c  \n#include \"libraries/ft_printf.h\"\n\nint\tmain(void)\n{\n\tchar *string;\n\t\n\tstring = \"larissa\";\n\tft_printf(\"%s \", string);\n\treturn (0);\n}\n```\nIf you try to compile your .c files with cc using \"cc main.c\" you will get an undefined symbol error for Libftprintf functions.\n\nYou have to tell the file which library it's using:\n```shell\n$ cc main.c libftprintf.a -o prog_example\n```\nTo run the program, enter the following in the command prompt:\n\n```shell\n$ ./prog_example\n```\nThe example I showed you will allow you to view a string of characters that will be displayed in your output terminal like this:\n```shell\n$ larissa\n```\n\nYou can try `c`, `s`, `p`, `d`, `i`, `u`, `x`, `X` or `%` conversions!\n\n```c\n#include \"libraries/ft_printf.h\"\n\nint\tmain(void)\n{\n\tft_printf(\"%d and %i is very %s\", 42, 42, \"cool\");\n\treturn (0);\n}\n```\nOutput:\n```\n42 and 42 is very cool\n```\n\n\n## 📋 Credits\n\n* [Acelera/Rodsmade](https://github.com/rodsmade/Projets_42_SP/)\n* [ft_printf_tester/paulo-santana/](https://github.com/paulo-santana/ft_printf_tester)\n* [printfTester/Tripouille](https://github.com/Tripouille/printfTester)\n\n\u003cp align=\"center\"\u003e Developed with love 💜 by Larissa Cristina Benedito (Mewmew/Larcrist). \u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmewmewdevart%2Fft_printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmewmewdevart%2Fft_printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmewmewdevart%2Fft_printf/lists"}