{"id":21363359,"url":"https://github.com/mxvements/ft_printf","last_synced_at":"2025-03-16T07:12:35.837Z","repository":{"id":201218243,"uuid":"706820364","full_name":"mxvements/ft_printf","owner":"mxvements","description":"Because ft_putnbr() and ft_putstr() aren’t enough.","archived":false,"fork":false,"pushed_at":"2024-07-20T14:08:06.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T19:34:20.151Z","etag":null,"topics":["42cursus","42madrid","42school","c"],"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/mxvements.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,"publiccode":null,"codemeta":null}},"created_at":"2023-10-18T17:19:44.000Z","updated_at":"2024-07-20T14:08:10.000Z","dependencies_parsed_at":"2024-11-22T07:01:11.234Z","dependency_job_id":null,"html_url":"https://github.com/mxvements/ft_printf","commit_stats":null,"previous_names":["mxvements/ft_printf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvements%2Fft_printf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvements%2Fft_printf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvements%2Fft_printf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxvements%2Fft_printf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxvements","download_url":"https://codeload.github.com/mxvements/ft_printf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243836025,"owners_count":20355616,"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":["42cursus","42madrid","42school","c"],"created_at":"2024-11-22T06:19:13.264Z","updated_at":"2025-03-16T07:12:35.814Z","avatar_url":"https://github.com/mxvements.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/status-finished-success?color=00ABAD\u0026style=flat-square\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/started-23%20%2F%2010%20%2F%202023-success?color=00ABAD\u0026style=flat-square\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/score-110%20%2F%20100-success?color=00ABAD\u0026style=flat-square\" /\u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/top/mxvements/ft_printf?color=00ABAD\u0026style=flat-square\" /\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/mxvements/ft_printf?color=00ABAD\u0026style=flat-square\" /\u003e\n    \u003cbr\u003e\n    \u003ca href='https://www.linkedin.com/in/luciami' target=\"_blank\"\u003e\u003cimg alt='Linkedin' src='https://img.shields.io/badge/LinkedIn-100000?style=flat-square\u0026logo=Linkedin\u0026logoColor=white\u0026labelColor=1323233\u0026color=323233'/\u003e\u003c/a\u003e\n    \u003ca href='https://profile.intra.42.fr/users/luciama2' target=\"_blank\"\u003e\u003cimg alt='42' src='https://img.shields.io/badge/Madrid-100000?style=flat-square\u0026logo=42\u0026logoColor=white\u0026labelColor=323233\u0026color=323233'/\u003e\u003c/a\u003e\n    \u003cbr\u003e\n\u003c/div\u003e\n\n# ft_printf\nThe goal of this project is pretty straightforward: to recode printf(). The projects is about learning variable numbber of arguments (variadic functions), as well as adding a couple more functions to the ft_libft.\n\n| Program name | libftprintf.a |\n| ----- | ------|\n| Turn in files | Makefile, *.h, *.c, */*.h, */*.c |\n| Makefile | NAME, all, clean, fclean, re and bonus (if done) |\n| External functs | malloc, free, write, va_start, va_arg, va_copy, va_end |\n| Libft authorized | Yes |\n| Description | Write a library that contains ft_printf(), a function that will mimic the original printf() |\n\n* Mandatory part\n\t-  Don’t implement the buffer management of the original printf().\n\t-  Your function has to handle the following conversions: cspdiuxX%\n\t-  Your function will be compared against the original printf().\n\t-  You must use the command ar to create your library. Using the libtool command is forbidden.\n\t-  Your libftprintf.a has to be created at the root of your repository.\n\t-  You have to implement the following conversions:\n\t\t-  %c Prints a single character.\n\t\t-  %s Prints a string (as defined by the common C convention).\n\t\t-  %p The void * pointer argument has to be printed in hexadecimal format.\n\t\t-  %d Prints a decimal (base 10) number.\n\t\t-  %i Prints an integer in base 10.\n\t\t-  %u Prints an unsigned decimal (base 10) number.\n\t\t-  %x Prints a number in hexadecimal (base 16) lowercase format.\n\t\t-  %X Prints a number in hexadecimal (base 16) uppercase format.\n\t\t-  %% Prints a percent sign.\n* Bonus\n\t-  Manage any combination of the following flags: ’-0.’ and the field minimum width under all conversions.\n\t-  Manage all the following flags: ´#´ ´ ´ ´+´ (Yes, one of them is a space)\n\nNote: if you plan to implement the bonus part, think abouut the impllementation of your extra features from the start. This way, youu will avoid the pitfalls of a naive approach.\n\n# How to use\n1 - Clone the repository\n```\ngit clone git@github.com:mxvements/ft_printf.git \n```\n2 - Enter the project folder and run `make`, Makefile rules:\n```\n`make` - compile printf mandatory files\n`make bonus` - compile printf bonus files\n`make all` - compile all (mandatory + bonus) files\n`make clean` - delete all *.o files\n`make fclean` - delete all *.o \u0026 *.a (executable) files\n`make re` - use fclean + all, recompile printf\n`make tclean` - added rule, delete all *.o \u0026 clean *.out file from test\n```\n3 - To incluide it in your code, include the header\n````\n# include \"ft_printf.h\"\n````\n # Notes\n ## On the printf() specifiers and flags\n 1 - Specifiers and output\n| sp | ft_printf() | description |\n| -- | ----------- | -------- |\n| %c |  √ | character | \n| %d or %i | √ | signed decimal integer | \n| %e |  | scientific noation (mantissa/exponent) using e char |\n| %E |  | Scientific notation (mantissa/exponent) using E char | \n| %f |  | decimal floating point | \n| %g |  | uses the shorter of %e or %f | \n| %G |  | uses the shorter of %E or %f | \n| %o |  | signed octal | \n| %s | √ | string of characters | \n| %u | √ | unsigned decimal integer | \n| %x | √ | unsigned hexadecimal integer | \n| %X | √ | unsigned hexadecimal integer (capital letters) | \n| %p | √ | pointer address | \n| %n |  | nothing printed | \n| % | √ | % char | \n \n 2 - Flags and description\n| specifier | ft_printf() | description |\n| --------- | ----------- | ----------- |\n| +\t| √ |  forces to precede the result with a plus or minus sign (+ or -) even for positive numbers. By default, only negative numbers are preceded with a -ve sign.\n| (space) | √ |  if no sign is going to be written, a blank spcace is inserted before the value\n| # | √ |  %#o %#x %#X -\u003e value precede with 0, 0x, 0X values != 0 / %#e %#E %#f -\u003e forces to contain a decimal point even if no digits would follow / %#g %#G -\u003e the same as w/ e or E, removing trailing 0\n| 0 |  |  left-pads the number with zeros (0) instead of spaces, where padding is specified (see width sub-specifier)\n\n## On variadic functions\n\n**void\tva_start(va_list argument_list, last_known_parameter);**\n\n- DESCRIPTION\n: va_start() macro, intializes your argument_list for use by va_arg() and va_end(), and must be called first. The last_known_parameter is the name of the last known parameter of the calling function, here, ft_printf();\n\n**argument_type\tva_arg(va_list argument_list, argument_type)**\n\n- DESCRIPTON: everytime it is called, it modifies argument_list so that the next time is is called, it will return the next argument.\n- RETURN VALUE: Expands to an expression that has the type and value of the next arg. in the call. The 1st use of the va_arg() macro after that of the va_start() macro returns the argument after last_known_parameter.\n- NOTES: Successive invocations return the values of the remaining arguments. It is your job to make sure you're giving va_arg() the correct type of variable to return, it will assume you know what's being sent.\n\n**void va_end(va_list argument_list)** \n\n- DESCRIPTION: Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function. After the call to va_end(), the variable argument_list is undefined.\n\n# Other\n\n## Norminete\nAt 42 School, it is expected that almost every project is written in accordance with the Norm, which is the coding standard of the school.\n\n\u003ca href=\"https://github.com/42School/norminette\"\u003e\n\u003ca\u003eNorminette's repository\u003c/a\u003e\n\n```\n- No for, do...while, switch, case, goto, ternary operators and variable-length arrays are allowed\n- Each function must be a maximum of 25 lines, not counting the function's curly brackets\n- Each line must be at most 80 columns wide, comments included\n- A function can take 4 named parameters maximum\n- No assigns and declarations in the same line (unless static or const)\n- You can't declare more than 5 variables per function\n- ...\n```\n## Aknowledgments\n- This video by Nikito: https://www.youtube.com/watch?v=Hb2m7htiKWM\n\n# License\n[MIT License](https://github.com/mxvements/ft_license/blob/main/LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxvements%2Fft_printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxvements%2Fft_printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxvements%2Fft_printf/lists"}