{"id":51284855,"url":"https://github.com/yomazini/42cursus-ft_printf","last_synced_at":"2026-06-30T04:30:59.330Z","repository":{"id":264930244,"uuid":"894176181","full_name":"yomazini/42cursus-ft_printf","owner":"yomazini","description":"A custom printf() implementation in C, developed as part of the 42 Network programming curriculum, showcasing string formatting and variadic function techniques.","archived":false,"fork":false,"pushed_at":"2025-07-01T23:50:46.000Z","size":1521,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T00:26:20.467Z","etag":null,"topics":["1337cursus","1337school","42cursus","ftprintf","ftprintf42"],"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/yomazini.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,"zenodo":null}},"created_at":"2024-11-25T22:21:45.000Z","updated_at":"2025-07-01T23:50:49.000Z","dependencies_parsed_at":"2025-01-02T14:36:19.091Z","dependency_job_id":null,"html_url":"https://github.com/yomazini/42cursus-ft_printf","commit_stats":null,"previous_names":["yomazini/42cursus-ft_printf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yomazini/42cursus-ft_printf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-ft_printf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-ft_printf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-ft_printf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-ft_printf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yomazini","download_url":"https://codeload.github.com/yomazini/42cursus-ft_printf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yomazini%2F42cursus-ft_printf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34952850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["1337cursus","1337school","42cursus","ftprintf","ftprintf42"],"created_at":"2026-06-30T04:30:55.775Z","updated_at":"2026-06-30T04:30:59.325Z","avatar_url":"https://github.com/yomazini.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🖨️ ft_printf | 42 School Project\n\n### Because standard `printf` is too mainstream😉\n\n![42 School Badge](https://img.shields.io/badge/42-School-blue)\n![Norminette](https://img.shields.io/badge/Norminette-passing-success)\n![Score](https://img.shields.io/badge/Score-100%2F100-brightgreen)\n\n\u003e *\"Why use standard printf when you can recreate the entire functionality from scratch?\"* - Every 1337/42 Student Do 😄\n\n## 🎯 Project Overview\n\nWelcome to my implementation of `ft_printf` - a custom printf function that replicates the behavior of the standard C library's `printf()`. This project is all about diving deep into variadic functions, type handling, and the intricate world of formatted output.\n\n### 🌟 Key Features\n\n- **Full Printf Functionality**: Supports multiple format specifiers\n- **Robust Error Handling**: Carefully managed edge cases\n- **Recursive Implementation**: Elegant and memory-efficient approach\n- **Extensible Design**: Easy to understand and modify\n- **No Standard Library Shortcuts**: Pure C implementation\n\n## 📋 Supported Format Specifiers\n\n| Specifier | Description | Example |\n|-----------|-------------|---------|\n| `%c` | Single character | `ft_printf(\"%c\", 'A')` |\n| `%s` | String | `ft_printf(\"%s\", \"Hello\")` |\n| `%d` | Signed decimal integer | `ft_printf(\"%d\", 1337)` |\n| `%i` | Signed decimal integer | `ft_printf(\"%i\", -17)` |\n| `%u` | Unsigned decimal integer | `ft_printf(\"%u\", 100)` |\n| `%x` | Lowercase hexadecimal | `ft_printf(\"%x\", 255)` |\n| `%X` | Uppercase hexadecimal | `ft_printf(\"%X\", 255)` |\n| `%p` | Pointer address | `ft_printf(\"%p\", \u0026var)` |\n| `%%` | Percent sign | `ft_printf(\"%%\")` |\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Variadic Function (Recommended Resources Below)\n- GCC compiler\n- Make\n\n---\n## **Variadic Function Resources** 🌟  \n\nBelow is a list of resources to help you master this topic, from detailed explanations to practical implementations.\n\n## **📺 Video Tutorials**  \n\n### 1. [Variadic Functions by Oceano](https://www.youtube.com/watch?v=7Sph8JlRo0g)  \n- 🎥 **Duration**: Approx. 17 minutes  \n- 🌊 **Overview**: Explores the basics of variadic functions, their syntax, and their practical applications. Perfect for beginners who enjoy a straightforward teaching style.\n\n### 2. [Variadic Functions by Code Vault](https://www.youtube.com/watch?v=oDC208zvsdg)  \n- 🎥 **Duration**: Approx. 13 minutes  \n- 🛠️ **Overview**: A more advanced look at variadic functions, focusing on real-world coding examples and detailed implementation tips.\n\n## **📚 Written Resources**  \n\n### 3. [Variadic Functions in C on GeeksforGeeks](https://www.geeksforgeeks.org/variadic-functions-in-c/)  \n- 🌐 **Type**: Article  \n- 📝 **Overview**: Covers the theoretical foundation, with code examples illustrating how variadic functions work. Includes topics like `stdarg.h` and the use of macros for handling arguments.  \n\n## **📌 Interactive Explanation**  \n\n### 4. [Detailed Variadic Function Explanation on Miro](https://miro.com/app/board/uXjVN-42a5k=/)  \n- 🖼️ **Type**: Interactive Board  \n- 🧩 **Overview**: A visual and detailed explanation of variadic functions. Great for those who learn best through diagrams and hands-on exploration.\n\n---\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/yomazini/42cursus-ft_printf.git\n```\n\n1. Navigate to the project directory:\n```bash\ncd 42cursus-ft_printf\n```\n\n1. Compile the library:\n```bash\n# Compile the library\nmake\n\n# Clean object files\nmake clean\n\n# Clean everything\nmake fclean\n\n# Recompile\nmake re\n\n# Test\nmake test\n\n```\n\n## 💡 Implementation Details\n\n### 🔍 Core Components\n\n- **Main Function**: [ft_printf](ft_printf.c) - The entry point that handles format string parsing\n- **Format Handler**: [ft_format_pf](ft_printf.c) - Dispatches to specific type handlers\n- **Type-Specific Handlers**:   \n   - [ft_putchar_pf](ft_putchar_pf.c): Character output   \n   - [ft_putstr_pf](ft_putstr_pf.c): String output   \n   - [ft_putnbr_pf](ft_putnbr_pf.c): Integer output   \n   - [ft_puthex_pf](ft_puthex_pf.c): Hexadecimal output   \n   - [ft_putunbr_pf](ft_putunbr_pf.c): Unsigned integer output   \n   - [ft_putadr_pf](ft_putadr_pf.c): Pointer address output\n\n### 🧠 Key Concepts Demonstrated\n\n- Variadic function handling with `\u003cstdarg.h\u003e`\n- Recursive printing techniques\n- Dynamic type conversion\n- Error management\n- Memory-efficient character-by-character output\n\n## 🔬 Interesting Challenges\n\n- Handling integer edge cases (e.g., INT_MIN)\n- Implementing hexadecimal conversion\n- Managing pointer address printing\n- Efficient recursive algorithms\n- Robust error handling\n\n## 📝 Usage Example\n\n```c\n#include \"ft_printf.h\"\n\nint main(void) {\n    int num = 42;\n    char *str = \"Hello, 42!\";\n    \n    ft_printf(\"Character: %c\\n\", 'A');\n    ft_printf(\"String: %s\\n\", str);\n    ft_printf(\"Decimal: %d\\n\", num);\n    ft_printf(\"Hex (lowercase): %x\\n\", num);\n    ft_printf(\"Hex (uppercase): %X\\n\", num);\n    ft_printf(\"Pointer: %p\\n\", (void*)\u0026num);\n    \n    return (0);\n}\n```\n\n## 🧪 Testing\n\nRecommended testing tools:\n- Custom test cases (Go Crazy 😉)\n- [printf-tester](https://github.com/Tripouille/printfTester)\n\n## 💻 Compilation\n\nTo use in your project:\n\n```bash\n# with main.c File\nmake test\n```\n\n## 🌈 Best Practices Demonstrated\n\n- Modular design\n- Extensive error checking\n- Memory safety\n- Efficient algorithms\n- Clear, readable code\n\n## 🏆 Performance Considerations\n\n- Minimal memory allocation\n- Recursive algorithms with O(log n) complexity\n- No unnecessary buffer usage\n\n## 📚 What I Learned\n\n- Advanced C programming techniques\n- Variadic function implementation\n- Deep understanding of type conversion\n- System-level output handling\n\n## 🤝 Contribution\n\nFeel free to:\n- Open issues\n- Submit pull requests\n- Provide feedback\n\n## 🎭 Author\n\nMade with ☕️ and ☕️☕️☕️ by Youssef Mazini (ymazini)\n- 42 Intra: [ymazini](https://profile.intra.42.fr/users/ymazini)\n- GitHub: [yomazini](https://github.com/yomazini)\n\n---\n\n\u003e *\"In printf we trust, one character at a time!\"* 😄\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyomazini%2F42cursus-ft_printf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyomazini%2F42cursus-ft_printf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyomazini%2F42cursus-ft_printf/lists"}