{"id":19344249,"url":"https://github.com/adebayo-s/printf","last_synced_at":"2025-04-23T04:36:18.144Z","repository":{"id":41895826,"uuid":"481951915","full_name":"Adebayo-S/printf","owner":"Adebayo-S","description":"🖨 created the printf function in C by @Adebayo-S and @Gejix","archived":false,"fork":false,"pushed_at":"2022-04-23T22:27:44.000Z","size":68,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T07:41:21.112Z","etag":null,"topics":["c","printf","variadic-function"],"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/Adebayo-S.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-15T12:30:36.000Z","updated_at":"2023-07-19T21:30:56.000Z","dependencies_parsed_at":"2022-08-11T20:31:27.709Z","dependency_job_id":null,"html_url":"https://github.com/Adebayo-S/printf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adebayo-S%2Fprintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adebayo-S%2Fprintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adebayo-S%2Fprintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adebayo-S%2Fprintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adebayo-S","download_url":"https://codeload.github.com/Adebayo-S/printf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372420,"owners_count":21419718,"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":["c","printf","variadic-function"],"created_at":"2024-11-10T03:42:57.920Z","updated_at":"2025-04-23T04:36:17.904Z","avatar_url":"https://github.com/Adebayo-S.png","language":"C","readme":"# 0x11. C - printf\n\n## Description\n\nThis printf project is a collaboration between Samuel Adebayo and Gerald Juwah. Who are Software Engineers studing at students of ALX school. This project involves a function named \"\\_printf\" which would imitate the actual \"printf\" command located in the stdio.h library. This function contains some of the basic features and functions found in the man 3 of \"printf\".\n\nWhat you would learn from this project:\n\n- How to use git in a team setting\n- Applying variadic functions to big projects\n- The complexities of printf\n- Managing a lot of flies and finding a good workflow\n\n## Prototype\n\n    int _printf(const char *format, ...);\n\n## Usage\n\n- Prints a string to the standard output, according to a given format\n- All files were created and compiled on Ubuntu 14.04.4 LTS using GCC 4.8.4 with the command `gcc -Wall -Werror -Wextra pedantic *.c`\n- Returns the number of characters in the output string on success, -1 otherwise\n- Call it this way: `_printf(\"format string\", arguments...)` where `format string` can contain conversion specifiers and flags, along with regular characters.\n\nThe **format** contains the string that is printed. As \\_printf() is variadic function, it can receives n arguments that replace by n tags written inside the string.\n\nThe format tags prototype is the following:\n\n    %[flags][length]specifier\n\nIf the program runs successfully, the return value is the amount of chars printed.\n\n| Specifier | Output              |\n| --------- | ------------------- |\n| c         | Character           |\n| d or i    | Decimal integer     |\n| s         | String              |\n| b         | Binary              |\n| %         | Percentage charater |\n| o         | Signed Octal        |\n| u         | Unsigned Integer    |\n| x         | Unsigned Hexadecimal|\n| X         | Unsigned Hexadecimal (uppercase) |\n| p         | Pointer address     |\n| r         | Reversr string of characters |\n| R         | ROT13 translaton of string |\n| S         | String with special chars replaced by their ASCII value |\n\n## Examples\n\n1. Printing the string of chars \"Hello ALX School\":\n\n   - Input: `\\_printf(\"Hello %s.\", \"ALX School\");`\n   - Output: `Hello ALX School`\n\n2. Printing an integer number:\n\n   - Input: `\\_printf(\"2 + 2 is equal to %d.\", 4);`\n   - Output: `2 + 2 is equal to 4`\n\n3. Printing a binary:\n\n   - Input: `\\_printf(\"98 in binary is [%b]\", 98);`\n   - Output: `98 in binary is [1100010]`\n\n## File Functions\n\n### \\_printf.c\n\nthe function that imitates printf(), by printing data.\n\n---\n\n### main.h\n\nHeader file where all Protypes are saved.\n\n---\n\n### man_3_printf\n\nmanpage file\n\n---\n\n### parse_char.c\n\nFunction that writes the Buffer Character.\n\n    /* Indetifier : %c */\n\n---\n\n### parse_int.c\n\nFunction that Prints an Integer.\n\n    /* Indetifier : %i or %d */\n\n---\n\n### parse_string.c\n\nFunction that Prints out a String.\n\n    /* Indetifier : %s */\n\n---\n\n### parse_binary.c\n\nFunction that Prints a Binary.\n\n    /* Indetifier : %b */\n\n---\n\n### parse_perc.c\n\nFunction that Prints a Percentage symbol.\n\n    /* Indetifier : %% */\n\n---\n### parse_oct.c\n\nFunction that Prints Decimal in Octal.\n\n\t/* Indetifier : %o */\n\n---\n\n### parse_hex.c\n\nFunction that Prints Decimal in Hexadecimal.\n\n\t/* Indetifier : %x */\n\n---\n\n### parse_x_X.c\n\nFunction that prints Decimal in Uppercase Hexadecimal.\n\n\t/* Indetifier : %X */\n\n---\n\n### parse_unit.c\n\nFunction that Prints an Unsigned Integer.\n\n\t/* Indetifier : %u */\n\n---\n\n### parse_buff.c\n\nFunction that Prints the Buffer\n\n---\n\n### CONTRIBUTION.md\n\nDocumentation stating the styleguide on how the work flow was carried out.\n\n---\n\n### .gitignore\n\nFiles to be ignored when pushing to github.\n\n---\n\n### project_junkyard\n\nFunction files used to run various tests on the \\_printf Function.\n\n---\n\n## Authors\n\n- `Samuel Adebayo` adebayo.samuel.olusegun@gmail.com\n- `Gerald Juwah` geraldjuwah@gmail.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadebayo-s%2Fprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadebayo-s%2Fprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadebayo-s%2Fprintf/lists"}