https://github.com/nabilac27/ft_printf
ft_printf is an implementation of printf function, utilizing variadic functions to handle formatted output with custom parsing and formatting logic.
https://github.com/nabilac27/ft_printf
dynamic-memory-allocation error-handling memory-management string-formatting string-manipulation variadic-function
Last synced: 3 months ago
JSON representation
ft_printf is an implementation of printf function, utilizing variadic functions to handle formatted output with custom parsing and formatting logic.
- Host: GitHub
- URL: https://github.com/nabilac27/ft_printf
- Owner: nabilac27
- Created: 2024-11-10T18:52:02.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-18T05:15:22.000Z (3 months ago)
- Last Synced: 2025-03-18T05:32:10.010Z (3 months ago)
- Topics: dynamic-memory-allocation, error-handling, memory-management, string-formatting, string-manipulation, variadic-function
- Language: C
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repository contains my implementation of the ft_printf function,
a fundamental part of the 42 School curriculum.The goal is to recreate the standard C printf function with specified
features and constraints while deepening understanding of variadic functions,
memory management, and formatted output.About ft_printf
printf is a variadic function, meaning it accepts a variable number of arguments.
The first argument is a format string that defines how the subsequent arguments are formatted and displayed.Key Concepts
Variadic Functions
The library provides macros for working with variadic functions:
va_start: Initializes a va_list for use.
va_arg: Retrieves the next argument in the list.
va_end: Cleans up the va_list when done.Return Type
Returns the total length of characters printed.
If an error occurs, ft_printf returns -1.