{"id":16319445,"url":"https://github.com/hima890/printf","last_synced_at":"2025-05-14T00:15:20.178Z","repository":{"id":200088733,"uuid":"704506664","full_name":"hima890/printf","owner":"hima890","description":"This project is an implementation of the printf function, a fundamental feature in the C programming language. Our custom printf function provides the capability to format and print various types of data, including text and variables, with the same level of flexibility and functionality as the standard printf in C.","archived":false,"fork":false,"pushed_at":"2023-10-21T06:53:00.000Z","size":546,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-25T15:41:53.465Z","etag":null,"topics":["alx-africa","alx-low-level-programming","c","printf-project"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hima890.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":"2023-10-13T12:05:32.000Z","updated_at":"2023-11-26T09:26:07.000Z","dependencies_parsed_at":"2023-10-15T18:00:19.206Z","dependency_job_id":"f588eca6-1641-43bf-bab4-af48bde7c428","html_url":"https://github.com/hima890/printf","commit_stats":null,"previous_names":["hima890/printf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hima890%2Fprintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hima890%2Fprintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hima890%2Fprintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hima890%2Fprintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hima890","download_url":"https://codeload.github.com/hima890/printf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239207389,"owners_count":19599963,"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":["alx-africa","alx-low-level-programming","c","printf-project"],"created_at":"2024-10-10T22:26:59.991Z","updated_at":"2025-02-16T22:45:01.531Z","avatar_url":"https://github.com/hima890.png","language":"C","readme":"![Printf Function](img.jpg)\r\n\r\n\r\n# Project Name: Custom printf Function 🚀\r\n\r\n## Table of Contents\r\n- [Description](#description)\r\n- [Usage](#usage)\r\n- [Supported Conversion Specifiers](#supported-conversion-specifiers)\r\n- [Custom Conversion Specifiers](#custom-conversion-specifiers)\r\n- [Repository](#repository)\r\n- [License](#license)\r\n- [By](#by)\r\n\r\n---\r\n\r\n## Description\r\n\r\nThis project is an implementation of a custom `printf` function in C. The function, named `_printf`, emulates the behavior of the standard C library `printf` with support for various format specifiers. The primary goal is to produce output according to a specified format and write it to the standard output stream (`stdout`).\r\n\r\nThe `_printf` function supports a subset of the format specifiers provided by the standard `printf` function. It also includes custom conversion specifiers for additional functionality. The function is designed to return the number of characters printed, excluding the null byte used to terminate output to strings.\r\n\r\nPlease note that this implementation does not handle various formatting options like flag characters, field width, precision, or length modifiers. It focuses on the basic functionality of formatting and printing data.\r\n\r\n## Usage\r\n\r\nTo use the custom `printf` function in your C program, follow these steps:\r\n\r\n1. Include the `main.h` header file in your source code.\r\n\r\n   ```c\r\n   #include \"main.h\"\r\n   ```\r\n\r\n2. Call the `_printf` function with the desired format and arguments. For example:\r\n\r\n   ```c\r\n   int chars_printed = _printf(\"Hello, %s! Your score is %d.\\n\", \"Alice\", 85);\r\n   ```\r\n\r\n3. The function will print the formatted output to the standard output stream (`stdout`) and return the number of characters printed.\r\n\r\n4. Make sure to link your program with the `printf` library.\r\n\r\n### Example:\r\n\r\n```c\r\n#include \"main.h\"\r\n\r\nint main() {\r\n    int score = 85;\r\n    int chars_printed = _printf(\"Hello, %s! Your score is %d.\\n\", \"Alice\", score);\r\n    return 0;\r\n}\r\n```\r\n\r\n## Supported Conversion Specifiers\r\n\r\nThe `_printf` function supports the following standard conversion specifiers:\r\n\r\n- `%c`: Character\r\n- `%s`: String\r\n- `%%`: Percentage sign\r\n- `%d` or `%i`: Signed integer\r\n\r\nIt also supports the following non-standard conversion specifiers:\r\n\r\n- `%u`: Unsigned integer\r\n- `%o`: Octal representation\r\n- `%x`: Hexadecimal representation (lowercase)\r\n- `%X`: Hexadecimal representation (uppercase)\r\n- `%p`: Pointer address\r\n\r\n## Custom Conversion Specifiers\r\n\r\nIn addition to the standard conversion specifiers, the `_printf` function supports several custom conversion specifiers:\r\n\r\n- `%b`: Binary representation of an unsigned integer\r\n- `%S`: String with non-printable characters escaped as `\\xXX` (hexadecimal ASCII code)\r\n- `%r`: Reversed string\r\n- `%R`: Rot13-encoded string\r\n\r\n## Repository\r\n\r\nYou can find the source code for this project in the following GitHub repository:\r\n\r\n- [GitHub Repository: printf](https://github.com/hima890/printf)\r\n- Cloing this repo get you \"140%🏆\" in the first deadline\r\n\r\nPlease feel free to clone, fork, or contribute to the repository as needed.\r\n\r\n## License\r\n\r\nThis project is provided under the open-source [MIT License](LICENSE). You are free to use, modify, and distribute it in accordance with the terms of the license.\r\n\r\n---\r\n\r\n## By\r\n- IBRAHIM HANAFI\r\n- AHMED BASHER\r\n- It well be nice if you gave us a star🌟 🙏\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhima890%2Fprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhima890%2Fprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhima890%2Fprintf/lists"}