https://github.com/thephoenix77/ft_printf
Creating a printf clone with the same behaviour as the predefined "printf" from the stdio C library.
https://github.com/thephoenix77/ft_printf
Last synced: about 1 month ago
JSON representation
Creating a printf clone with the same behaviour as the predefined "printf" from the stdio C library.
- Host: GitHub
- URL: https://github.com/thephoenix77/ft_printf
- Owner: ThePhoenix77
- Created: 2024-03-06T13:41:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-20T21:52:16.000Z (over 1 year ago)
- Last Synced: 2025-01-19T15:39:46.605Z (9 months ago)
- Language: C
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Custom Printf Implementation (ft_printf)
This is a custom implementation of the `printf` function in C, named `ft_printf`, developed as part of the `libft` library.
## Description
`ft_printf` is a variadic function that formats and prints data to the standard output according to a format string. It supports a subset of the format specifiers available in the standard `printf` function.
## Features
- Supports the following format specifiers:
- `%c`: Character
- `%s`: String
- `%p`: Pointer
- `%d`, `%i`: Signed integers
- `%u`: Unsigned integers
- `%x`: Hexadecimal (lowercase)
- `%X`: Hexadecimal (uppercase)
- `%%`: Percent sign- Additional features:
- Handles null pointers gracefully
- Properly handles width and precision specifiers (not yet implemented)## Usage
To use `ft_printf`, include the header file `ft_printf.h` and link the library in your project.
```c
#include "ft_printf.h"int main() {
ft_printf("Hello, %s!\n", "world");
return 0;
}```
## Building
To build ft_printf, simply compile the source files along with your project:```bash
gcc -o my_program my_program.c ft_printf.c [other_source_files.c] -I.
```## Authors
Boussaden TAHA [tn_ix77]
## ContactIf you have any questions, suggestions, or issues, feel free to contact the project maintainer:
- Boussaden Taha
- tahaboussaden7322@gmail.com